answersLogoWhite

0

These are terms given to the various scenarios which can be encountered by an algorithm.

The best case scenario for an algorithm is the arrangement of data for which this algorithm performs best. Take a binary search for example. The best case scenario for this search is that the target value is at the very center of the data you're searching. So the best case time complexity for this would be O(1).

The worst case scenario, on the other hand, describes the absolute worst set of input for a given algorithm. Let's look at a quicksort, which can perform terribly if you always choose the smallest or largest element of a sublist for the pivot value. This will cause quicksort to degenerate to O(n2).

Discounting the best and worst cases, we usually want to look at the average performance of an algorithm. These are the cases for which the algorithm performs "normally."

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

What is the difference between AES Rijndael symmetric algorithm encryption and a hash algorithm?

678


What is the relationship between Big O notation and induction in algorithm analysis?

In algorithm analysis, Big O notation is used to describe the upper bound of an algorithm's time complexity. Induction is a mathematical proof technique used to show that a statement holds true for all natural numbers. In algorithm analysis, induction can be used to prove the time complexity of an algorithm by showing that the algorithm's running time follows a certain pattern. The relationship between Big O notation and induction lies in using induction to prove the time complexity described by Big O notation for an algorithm.


What is the difference between P and NP complexity classes?

P is the class of problems for which there is a deterministic polynomial time algorithm which computes a solution to the problem. NP is the class of problems where there is a nondeterministic algorithm which computes a solution to the problem, but no known deterministic polynomial time solution


What is difference between lemma and algorithm?

A Method that used to be a comouter to soultion of promlems is called algorithm.


What is the difference between procedure and algorithm?

A procedure can go on forever.Where as an Algorithm, will eventually terminate and will have each step precisely defined.


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.


Difference between Bresenham and midpoint circle drawing algorithm?

what is difference between mid-point and bresenhams circle algorithm what is difference between mid-point and bresenhams circle algorithm bresenhams circle algorithm results in a much more smoother circle,comparred to midpoint circle algorithm..In mid point,decision parameter depends on previous decision parameter and corresponding pixels whereas in bresenham decision parameter only depends on previous decision parameter...


What is the difference between an algorithm and flow chart WITH examples?

An algorithm is a method of solving a problem. A flow chart is a tool for visualizing algorithms.


What is the difference between the time complexity of O(1) and O(n) and how does it impact the efficiency of algorithms?

The time complexity of O(1) means that the algorithm's runtime is constant, regardless of the input size. On the other hand, O(n) means that the algorithm's runtime grows linearly with the input size. Algorithms with O(1) time complexity are more efficient than those with O(n) time complexity, as they have a fixed runtime regardless of the input size, while algorithms with O(n) will take longer to run as the input size increases.


What is the difference between the time complexity of algorithms with O(n) and O(log n) and how does it impact the efficiency of the algorithm?

The time complexity of an algorithm with O(n) grows linearly with the input size, while O(log n) grows logarithmically. Algorithms with O(log n) are more efficient as the input size increases because they require fewer operations to complete compared to algorithms with O(n).


What is the difference between polynomial and non polynomial time complexity?

Polynomial vs non polynomial time complexity


What is the difference between advanced encryption algorithm and encryption algorithm?

People have developed many encryption algorithms. One particular encryption algorithm is the Rijndael algorithm, usually called the AES or Advanced Encryption Standard.