Strictly Ordered Time Complexity Classes
| Efficiency | Notation | Name | Growth Rate Description | Max Input Size (n) for ≈1 Sec |
|---|
| 1 (Fastest) | O(1) | Constant | Execution time is completely unaffected by input size. | Virtually Infinite |
| 2 | O(loglogn) | Double Logarithmic | Grows so slowly that it is practically indistinguishable from constant time. | Virtually Infinite |
| 3 | O(logn) | Logarithmic | Highly efficient; the problem space is divided (usually halved) at each step. | Virtually Infinite (n≈10300+) |
| 4 | O(n) | Fractional Power / Sublinear | Grows slower than linear, commonly seen in algorithms like search blocks. | n≈1016 |
| 5 | O(n) | Linear | Scales perfectly 1:1 with the size of the input. | n≈108 (100 million) |
| 6 | O(nlog∗n) | Iterated Linear | Scaled by the iterated logarithm (which never exceeds 5 for any practical universe-sized input). | n≈108 |
| 7 | O(nlogn) | Linearithmic | Each input element performs a logarithmic operation (the lower bound for comparison sorting). | n≈107 (10 million) |
| 8 | O(n2) | Quadratic | Growth scales with the square of the input (standard nested loops). | n≈104 (10,000) |
| 9 | O(n3) | Cubic | Growth scales with the cube of the input (triple nested loops). | n≈500 |
| 10 | O(2n) | Exponential | The computation time doubles with every single addition to the input size. | n≈25 to 30 |
| 11 | O(n!) | Factorial | Grows incredibly fast; scales with all permutations of the input. | n≈11 |
| 12 (Slowest) | O(nn) | Superexponential | The absolute worst scaling; grows faster than factorial. | n≈8 |


Common Data Structure Operations
| Data Structure | Average Access | Average Search | Average Insertion | Average Deletion | Worst Access | Worst Search | Worst Insertion | Worst Deletion | Worst Space |
|---|
| Array | Θ(1) | Θ(n) | Θ(n) | Θ(n) | O(1) | O(n) | O(n) | O(n) | O(n) |
| Stack | Θ(n) | Θ(n) | Θ(1) | Θ(1) | O(n) | O(n) | O(1) | O(1) | O(n) |
| Queue | Θ(n) | Θ(n) | Θ(1) | Θ(1) | O(n) | O(n) | O(1) | O(1) | O(n) |
| Singly-Linked List | Θ(n) | Θ(n) | Θ(1) | Θ(1) | O(n) | O(n) | O(1) | O(1) | O(n) |
| Doubly-Linked List | Θ(n) | Θ(n) | Θ(1) | Θ(1) | O(n) | O(n) | O(1) | O(1) | O(n) |
| Skip List | Θ(logn) | Θ(logn) | Θ(logn) | Θ(logn) | O(n) | O(n) | O(n) | O(n) | O(nlogn) |
| Hash Table | N/A | Θ(1) | Θ(1) | Θ(1) | N/A | O(n) | O(n) | O(n) | O(n) |
| Binary Search Tree | Θ(logn) | Θ(logn) | Θ(logn) | Θ(logn) | O(n) | O(n) | O(n) | O(n) | O(n) |
| Cartesian Tree | N/A | Θ(logn) | Θ(logn) | Θ(logn) | N/A | O(n) | O(n) | O(n) | O(n) |
| B-Tree | Θ(logn) | Θ(logn) | Θ(logn) | Θ(logn) | O(logn) | O(logn) | O(logn) | O(logn) | O(n) |
| Red-Black Tree | Θ(logn) | Θ(logn) | Θ(logn) | Θ(logn) | O(logn) | O(logn) | O(logn) | O(logn) | O(n) |
| Splay Tree | N/A | Θ(logn) | Θ(logn) | Θ(logn) | N/A | O(logn) | O(logn) | O(logn) | O(n) |
| AVL Tree | Θ(logn) | Θ(logn) | Θ(logn) | Θ(logn) | O(logn) | O(logn) | O(logn) | O(logn) | O(n) |
| KD Tree | Θ(logn) | Θ(logn) | Θ(logn) | Θ(logn) | O(n) | O(n) | O(n) | O(n) | O(n) |
Array Sorting Algorithms
| Algorithm | Best Time Complexity | Average Time Complexity | Worst Time Complexity | Worst Space Complexity |
|---|
| Quicksort | Ω(nlogn) | Θ(nlogn) | O(n2) | O(logn) |
| Mergesort | Ω(nlogn) | Θ(nlogn) | O(nlogn) | O(n) |
| Timsort | Ω(n) | Θ(nlogn) | O(nlogn) | O(n) |
| Heapsort | Ω(nlogn) | Θ(nlogn) | O(nlogn) | O(1) |
| Bubble Sort | Ω(n) | Θ(n2) | O(n2) | O(1) |
| Insertion Sort | Ω(n) | Θ(n2) | O(n2) | O(1) |
| Selection Sort | Ω(n2) | Θ(n2) | O(n2) | O(1) |
| Tree Sort | Ω(nlogn) | Θ(nlogn) | O(n2) | O(n) |
| Shell Sort | Ω(nlogn) | Θ(n(logn)2) | O(n(logn)2) | O(1) |
| Bucket Sort | Ω(n+k) | Θ(n+k) | O(n2) | O(n) |
| Radix Sort | Ω(nk) | Θ(nk) | O(nk) | O(n+k) |
| Counting Sort | Ω(n+k) | Θ(n+k) | O(n+k) | O(k) |
| Cubesort | Ω(n) | Θ(nlogn) | O(nlogn) | O(n) |