Searching and Sorting
Best Case
|
Worst Case
|
Average Case
|
|
Binary Search
|
O( 1 )
|
O ( log n )
|
log (n)
|
Linear Search
|
O( 1 )
|
O( n )
|
O( n )
|
Bubble Sort
|
O(n2)
|
O(n2)
|
O(n2)
|
Selection Sort
|
O(n)
|
O(n2)
|
O(n2)
|
Insertion Sort
|
O(n)
|
O(n2)
|
O(n2)
|
Merge Sort
|
O(n log n)
|
O(n log n)
|
O(n log n)
|
Heap Sort
|
Ὼ(n log n)
|
O(n log n)
|
O(n log n)
|
Quick Sort
|
O(n log n)
|
O(n2)
|
O(n log n)
|
Tree Sort
|
O(n log n)
|
O(n2)
|
O(n log n)
|
Shell Sort
|
O(n)
|
O(n log2n)
|
depends
|
Counting Sort
|
O(n)
|
O(n)
|
O(n)
|
Bucket
|
O(n)
|
O(n)
|
O(n)
|
Radix Sort
|
O(n)
|
O(n)
|
=<O(n2)
|
No comments