Loading Shrinkify...
Loading Shrinkify...
Review common Big O time and space complexities for arrays, trees, heaps, hash maps, and graph algorithms.
Visual practice for graph traversal, sorting, complexity understanding, and interview prep.
Quick interview reference for common data structures and operations.
Array
Access O(1) · Search O(n) · Insert/Delete O(n)
Hash Map
Lookup O(1) avg · Insert O(1) avg · Worst O(n)
Stack/Queue
Push/Pop O(1) · Peek O(1) · Array or linked list backed
Binary Search Tree
Search O(log n) avg · Insert O(log n) avg · Worst O(n)
Heap
Insert O(log n) · Extract O(log n) · Peek O(1)
Graph (Adj List)
BFS/DFS O(V+E) · Space O(V+E) · Unweighted shortest path via BFS
Dynamic Programming
Top-down memoization · Bottom-up tabulation · Optimize with state compression
Big-O complexity is the most consistently tested topic in technical interviews. The DSA Complexity Cheatsheet collects time and space complexity for every major data structure and algorithm — organized for quick lookup during problem-solving and preparation.
A mathematical notation for describing algorithm complexity as input size grows — expressing upper bounds on time or space usage.
For n=1000: O(n log n) ≈ 10,000 operations; O(n²) = 1,000,000. The gap grows dramatically with larger inputs.
Hash maps (hash tables) provide average O(1) lookup, insert, and delete. Worst case is O(n) on hash collision.
Check out our technical guides to learn more about how browser-side processing works.
Read Glossary