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

16y 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.


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 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 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 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 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 polynomial and non polynomial time complexity?

Polynomial vs non polynomial time complexity


What are the difference between greedy algorithm and dynamic programing?

A greedy algorithm is similar to a dynamic programming algorithm, but the difference is that solutions to the subproblems do not have to be known at each stage; instead a "greedy" choice can be made of what looks best for the moment.

Trending Questions
At what stage should you begin to think about the kinds of data analysis you need to conduct? How quick does it take an girl to get pregnant? How do you find gain percent? What is a high average IQ? In an uniform distribution is the mean and median the same? How do you find the quartiles of a data set? There is a 80 percent chance of rain today and a 50 percent chance of rain tomorrow If the two events are independent what is the probability that it will rain today or tomorrow? What is 82.946 to the nearest hundredth? Find the z-score for which 92 percent of the distribution's area lies between -z and z? Why is it more useful to present results in a line graph? How many different ways can you arrange four pictures on a wall if you want them in a straight line horizontally? What is 0.3644 rounded to the thousandths place? Which variables can be classified as quantitative? What does high and low infiltration rates mean? A test has 2 multiple choice questions each with 5 choices what is the probability of guessing the correct answers to both questions? Can non -probability sampling be used in descriptive research? A statement of probability that the experimental outcome was due to random variation is known as what? How do you determine coefficient of determination in excel? What if you took plan bmorning after pill after unprotected sex and then a week later had unprotected sex again without the pill does it increase the chances of pregnancy in the second time? What is the probability of a down syndrome carrier male and a non-carrier female producing non-carrier children?