next up previous
Next: 1.2.6 Big Omega and Big Theta Notations Up: 1.2 Complexity of Algorithms Previous: 1.2.4 Role of the Constant

1.2.5 Worst Case, Average Case, and Amortized Complexity

1.
For example, consider the problem of finding the minimum element in a list of elements.
Worst case = O(n)
Average case = O(n)

2.
Quick sort
Worst case = O(n2)
Average case = O(n log n)

3.
Merge Sort, Heap Sort
Worst case = O(n log n)
Average case = O(n log n)

4.
Bubble sort
Worst case = O(n2)
Average case = O(n2)

5.
Binary Search Tree: Search for an element

Worst case = O(n)
Average case = O(log n)


next up previous
Next: 1.2.6 Big Omega and Big Theta Notations Up: 1.2 Complexity of Algorithms Previous: 1.2.4 Role of the Constant
eEL,CSA_Dept,IISc,Bangalore