Big ‘O’ notation and Efficiency of sorting
Big O notation, often written as O(), in the context of algorithm analysis, it's used to describe the worst-case scenario for the time or space complexity of an algorithm.
| Algorithm | Best Case | Average Case | Worst Case | Space |
|-----------|-----------|--------------|------------|-------|
| Insertion | O(n) | O(n^2) | O(n^2) | O(1) |
| Merge | O(n log n)| O(n log n) | O(n log n) | O(n) |
| Radix | O(n * k) | O(n * k) | O(n * k) | O(n+k)|
| Shell | O(n log n)| - | O(n(log n)^2)| O(1) |
| Heap | O(n log n)| O(n log n) | O(n log n) | O(1) |