Big-O Reference Chart
Big-O notation reference for common algorithms and data structures with time and space complexity.
Complexity Scale (Best to Worst)
| Algorithm | Best | Average | Worst | Space |
|---|---|---|---|---|
| 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(n log n) | O(n log n) | O(n log n) | O(n) |
| Quick Sort | O(n log n) | O(n log n) | O(n^2) | O(log n) |
| Heap Sort | O(n log n) | O(n log n) | O(n log n) | O(1) |
| Counting Sort | O(n+k) | O(n+k) | O(n+k) | O(k) |
| Radix Sort | O(nk) | O(nk) | O(nk) | O(n+k) |
| Linear Search | O(1) | O(n) | O(n) | O(1) |
| Binary Search | O(1) | O(log n) | O(log n) | O(1) |
| Array Access | O(1) | O(1) | O(1) | O(n) |
| Array Insert | O(1) | O(n) | O(n) | O(n) |
| Linked List Access | O(1) | O(n) | O(n) | O(n) |
| Linked List Insert | O(1) | O(1) | O(1) | O(n) |
| Hash Table Search | O(1) | O(1) | O(n) | O(n) |
| BST Search | O(log n) | O(log n) | O(n) | O(n) |
| BFS | O(V+E) | O(V+E) | O(V+E) | O(V) |
| DFS | O(V+E) | O(V+E) | O(V+E) | O(V) |
| Dijkstra's | O(E log V) | O(E log V) | O(E log V) | O(V) |
About Big-O Notation
Big-O notation describes the upper bound of an algorithm's growth rate. It helps compare algorithms by their efficiency as input size increases.
Some links on this page are affiliate links. If you click and make a purchase, we may earn a commission at no extra cost to you.
Recommended Products
AdAffiliate Disclosure: As an Amazon Associate, ToolBird earns from qualifying purchases. Links above are affiliate links — if you buy through them, we may earn a small commission at no extra cost to you.
Disclaimer: This tool is provided as-is for informational and educational purposes only.