Table of Algorithms
Sorting Algorithms | Avg T | Best T | Wosrt T | Space Complexity |
---|---|---|---|---|
Linear Search | O(1) | O(n) | O(n) | O(1) |
Binary Search | O(1) | O(log n) | O(log n) | O(1) |
Bubble Sort | O(n) | O(n^2) | O(n^2) | O(1) |
Selection Sort | O(n^2) | O(n^2) | O(n^2) | O(1) |
Insertion Sort | O(n) | O(n^2) | O(n^2) | O(1) |
Merge Sort | O(nlog n) | O(nlog n) | O(log n) | O(n) |
Quick Sort | O(nlog n) | O(nlog n) | O(n^2) | O(log n) |
Heap Sort | O(nlog n) | O(nlog n) | O(nlog n) | O(n) |
Bucket Sort | O(n+k) | O(n+k) | O(n^2) | O(n) |
Radix Sort | O(nk) | O(nk) | O(nk) | O(n+k) |
Tim Sort | O(n) | O(nlog n) | O(nlog n) | O(n) |
Shell Sort | O(n) | O((nlog(n))^2) | O((nlog(n))^2) | O(1) |