answersLogoWhite

0

📱

Computer Science

Computer Science is the systematic study of algorithmic processes that describe and transform information. It includes the theoretical foundations of information and computation and the practical techniques of applying those foundations to computer systems. Among the many subfields of Computer Science are computer graphics, computer programming, computational complexity theory, and human-computer interaction. Questions about Computer Science, terms such as algorithms and proofs, and methodologies are encouraged in this category.

1,839 Questions

Which is a type of data?

There are several different types of data. Some include qualitative and quantitative. Qualitative is data that is not numeric and quantitative data is numerical.

What is the body of a loop?

The "body" of a loop is the code being executed on each iteration.

while(x < 10) {

// beginning of body
doStuff();
printStuff();
doOtherStuff();
++x;
// end of body
}

How do you calculate time complexity for insertion sort?

1.for j = 2 to length[A] c1 n

2. do key ¬ A[j] c2 n-1

3. //insert A[j] to sorted sequence A[1..j-1] 0 n-1

4. i ¬ j-1 c4 n-1

5. while i >0 and A[i]>key c5 Sum (j=2->n) tj

6. do A[i+1] ¬ A[i] c6 Sum (j=2->n) (tj -1)

7. i ¬ i-1 c7 Sum (j=2->n) (tj -1)

8. A[i+1] ¬ key c8 n -1

Sum j=2->n tj evaluates to (n(n+1)/2)-1 and j=2->(tj-1) evaluates to n(n-1)/2

thus the highest order term after droping constants becomes n2 thus the complexity is n2

What is a bar gragh?

.)A graph consisting of parallel, usually vertical bars or rectangles with lengths proportional to the frequency with which specified quantities occur in a set of data. Also called bar chart

What degree should I choose Engineering or Computer Science I have the opportunity to go for free to a school that doesnt offer Engineering but does offer Computer Science what should I do?

The best course to study is the one that leads to your overall career goals and objectives. Thus, I would imagine you do not have anything specific at this time. So many individuals enroll in college programs without a specific goal in mind. As such, many become miserable in their work which is not good for them, or their employer. If you want to be successful in your work and personal life, carefully consider the following.

To be successful in your work, you must acquire a vision. A vision is a clearly articulated picture of the future you intend to create for yourself. In other words, it's a dream. However, if the dream does not have direction, it will always remain a dream and will never become a reality for you. That vision should create a passion within you, a love for what you do and the benefit it will bring to others as well as yourself. Make sure the vision is specific, measurable, attainable, realistic, and tangible. Let us look at this closer. When you believe you have chosen an appropriate career goal, look at it in SMART fashion as follows. * Specific - Make sure your career goal is very specific. For example, "I would like to be a teacher," is not specific. "I would like to be a high school biology teacher in New Jersey (USA) in an urban school by 2012" is. * Measurable - Make sure you can measure your progress. How will I know I am progressing in the right direction? This is where the development of short-term objectives comes in (discussed below). You will know you are on the right path as you accomplish each short -term objective. * Achievable - Is the goal achievable considering my current life situation and circumstances? * Realistic - Is what I want to do really realistic. For example, "I would like to be a middle weight boxing champion, and I am 63 years old." That is not realistic. * Tangible - What will I - specifically - have at the end? What will I be (exactly)? It must be very specific. Once you acquire that vision your path will become clear. Still, you will need a mentor, counselor, or coach who will be able to help you develop a road map embedded with short-term objectives leading to your overall career overall goals and objectives. The achievement of short-term objectives will indicate you are moving in the correct direction, and will also give you energy and excitement to carry on towards your overall career goal. It will take some research, but you most likely have some ideas already. Follow them through, look at the nature of the field, the everyday routine, the required education, the salary, the occupational demand and the related fields. When a career sparks an interest, try to shadow an individual who is actually doing what you think you might like to do. You can pick up valuable information this way. Thus, the following. * Acquire the will to change circumstances. * Acquire the vision (dream). * Develop a road-map embedded with short-term objectives leading to your overall goal and objective. * Just do it and do not let go until it becomes a reality.

Algorithm for conversion from prefix to infix?

The belt-and-braces technique is easy enough:

>

> prefix_to_infix(stream, stack)

> if stack is not empty

> pop a node off the stack

> if this node represents an operator

> write an opening parenthesis to stream

> prefix_to_infix(stream, stack)

> write operator to stream

> prefix_to_infix(stream, stack)

> write a closing parenthesis to stream

> else

> write value to stream

> endif

> endif

> endfunc

Define the languages accepted by NFA and DFA?

In general, finite state machines can model regular grammars.

Deterministic finite automata can represent deterministic context-free grammars.

Non-deterministic finite automata can represent context-free grammars.

What is the conclusion of Keystroke dynamics as a biometric for authentication?

It is behavioral biometric. It is used to describe how an individualaddresses the keys on the keyboard. As biometrics go, it has a great price to performance ratio, as it is software only, requiring no special hardware. Purely based on accuracy, it is slightly less accurate than low end fingerprint readers, when comparing crossover error rate.

How do you calculate time complexity for Quicksort?

First, we want to set up a recurrence relation. If we consider the best-case for the quicksort, that is, that each partition splits the collection in 1/2 (not a valid assumption), then (look at a recursive quicksort algorithm):

The partition requires about n comparisons. It is then left to sort 2 collections of size n/2. So:

T(n) = 2*T(n/2) + n

Use repeated substitution, or the "master theorem" or whatever it's called, a generalisation of closed forms, or draw a tree, or use the accounting method, or guess at the answer, prove it by induction.

Now, we need to consider the worst case. The partition still costs the same (about n comparisons), but the partition didn't yield 2 nice-sized sub-collections to sort. Instead, we have a single sub-array to sort, of size n-1 . So now the recurrence relation looks like:

T(n) = T(n-1) + n

Solve this in your favorite way.

Now, on average, how good is your algorithm? That depends on how well you choose your pivot. You can do some reasoning, or, you can run some nice experiments.

Have fun.

What is the worst case and best case for binary search?

The best case for a binary search is finding the target item on the first look into the data structure, so O(1).

The worst case for a binary search is searching for an item which is not in the data. In this case, each time the algorithm did not find the target, it would eliminate half the list to search through, so O(log n).

Difference between DFA and NFA?

Hi,

1. DFA cannot use empty string transition and NFS can use empty string transition.

2. It use one machine but it use multiple machine.

3. DFA is one state transition but NFA react according to some symbol.

Explain about primary key super key candidate key alternate key composite key foreign key?

KEYS IN SQL

* Alternate key - An alternate key is any candidate key which is not selected to be the primary key

* Candidate key - A candidate key is a field or combination of fields that can act as a primary key field for that table to uniquely identify each record in that table.

For Eg:

The table:

Emloyee(Name,Address,Ssn,Employee_Idprimary_key,Phone_ext)

In the above example Ssn no. and employee identity are ccandidate keys.

* Compound key - compound key (also called a composite key or concatenated key) is a key that consists of 2 or more attributes.

* Primary key - a primary key is a value that can be used to identify a unique row in a table. Attributes are associated with it. Examples of primary keys are Social Security numbers (associated to a specific person) or ISBNs (associated to a specific book).

In the relational model of data, a primary key is a candidate key chosen as the main method of uniquely identifying a tuple in a relation.

For Eg:

Emloyee(Name,Address,Ssn,Employee_Idprimary_key,Phone_ext)

* Superkey - A superkey is defined in the relational model as a set of attributes of a relation variable (relvar) for which it holds that in all relations assigned to that variable there are no two distinct tuples (rows) that have the same values for the attributes in this set. Equivalently a superkey can also be defined as a set of attributes of a relvar upon which all attributes of the relvar are functionally dependent.

For Eg:

Emloyee(Name,Address,Ssn,Employee_Idprimary_key,Phone_ext)

All the above are super keys.

* Foreign key - a foreign key (FK) is a field or group of fields in a database record that points to a key field or group of fields forming a key of another database record in some (usually different) table. Usually a foreign key in one table refers to the primary key (PK) of another table. This way references can be made to link information together and it is an essential part of database normalization.

For Eg:

For a Student....

School(Name,Address,Phone,School_Reg_noprimary_key

Which degree is better between applied mathematics computer science and statistics and which one is the second one?

It's not that one is better than the other, it's just that they are different. The question is, "which one is better for you?" The first thing you must do is acquire a vision for yourself; a specific and clearly articulated picture of the future you intend to create for yourself. This vision should be based on a passion for what you want to do, and the benefit it brings to others as well as yourself. Once you acquire that vision your path will become clear. Each of these fields have possibilities, but only passion will lead to success. Passion is key to success.

How to write an actual algorithm for inserting an element in a linked list?

Insert newNode into a linked list after targetNode

Node currentNode = root

while currentNode != targetNode

currentNode = currentNode.next

newNode.next = currentNode.next

currentNode.next = newNode

What is Functional dependency and normalization for database?

A functional dependency occurs between two attributes in a database, A and B, if there exists a relationship such that for each value of A there is only one corresponding value of B (A -> B). This can be extended to a functional dependency where A may be a set of tuples (x, y, z) that correspond to a single value B ([x, y, z] -> B). In simple mathematical terms the functional dependency must pass the vertical line test for proper functions. Normalization of a relational database means that the relations (tables) in the database conform to a set of rules for a certain normal form (First - Sixth Normal Form [1-6NF] and/or Boyce-Codd Normal Form [BCNF]). The higher the normal form of a table the less vulnerable it is to data inconsistency and data anomalies formed during updates, inserts, and deletes. Normalization often reduces data redundancy in a database which reduces data inconsistency and anomaly risks. Normalizing a database requires analysis of the closure of the set of functional dependencies to ensure that the set complies with the rules for the given normal form. If the table does not comply with the rules then the table is split following specific procedures to achieve the desired normal form. Every table in a database has a normal form and to make a statement that a database is in a certain normal form (ex. 3NF) means that every table complies with the rules for 3NF.

What do you mean by logical configuration?

pls, i want you to give me a full meaning of logical configuration

If an image is reduced by a scale factor of 75 percent what scale factor is used to return the image to its original size?

75%= .75 = 3/4

So, to scale it down, it was multiplied by a factor of 3/4. To get it back up, divide by 3/4 (which is to say, multiply by 4/3 = 1.3333 = 133.33%

Difference between greedy algorithm and dynamic programming?

the basic difference between them is that in greedy algorithm only one decision sequence is ever generated.

where as in dynamic programming many decision sequences are generated.

What are computer problems of class NP?

NP stands for Nondeterministic Polynomial time, and is a class of complexity of problems. A problem is in NP if the computing time needed grows exponentially with the amount of input, but it only takes polynomial time to determine if a given solution is correct or not.

It is called nondeterministic because a computer that always automatically chooses the right course of action in each step would come up with a correct solution in polynomial time.

What is meant by process in computer science?

When you tell your computer to run a program, a new process is created which runs the code in that program. A process is an instance of a program.

What is a fuzzy logic?

A mathematical technique for dealing with imprecise data and problems that have many solutions rather than one. Although it is implemented in digital computers which ultimately make only yes-no decisions, fuzzy logic works with ranges of values, solving problems in a way that more resembles human logic. Fuzzy logic is used for solving problems with expert systems and real-time systems that must react to an imperfect environment of highly variable, volatile or unpredictable conditions. It "smoothes the edges" so to speak, circumventing abrupt changes in operation that could result from relying on traditional either-or and all-or-nothing logic.

What is an atomic web service?

an atomic service, whose implementation is self contained and does not invoke any other services.

How can Repititive Strain Injury affect a person using the computer?

Repetitive strain injuries occur when tendons move through lubricated sheaths called bursae (the sheaths go by a variety of other names as well - see http://www.forensic-applications.com/cts/cts.html ). If the tendon moves through the bursae in such a manner as to cause inflammation, then the cross section of the bursa becomes smaller which then creates more friction which exacerbates the problem in a positive feedback loop. Preventing the inflammation in the first place is much more effective than breaking the cycle. Prevention is effected by observing good ergonomic principles. "Ergonomics" means fitting the workplace to the person - ergonomics is NOT applying the use of "ergonomic" apparel or prophylactics such as wrist splints, and wrist rests. The use of the products are usually "anti-ergonomic" and can often create a problem, or exacerbate an existing problem. In the case of the computer work station, the station should be adjusted specifically for the person in question, the angle of the screen, the height, and pitch for the chair, the location of the keyboard, the length of time typing between breaks, and even the temperature of the work environment are all legitimate ergonomic considerations. For an example of an ergonomic evaluation see of a computer work station see: http://forensic-applications.com/index_files/anne.jpg Repetitive stress syndrome injuries can result in permanent loss of the limb.