Big-O cheat sheet
Time and space complexity of every data structure and algorithm on BytePatterns, from hash tables to Dijkstra, each row linked to its animated lesson.
78 rows · 94 lessons linked · updated
Growth orders
- O(1)constant · Constant or logarithmic
- O(log n)logarithmic · Constant or logarithmic
- O(n)linear · Linear or n log n
- O(n log n)linearithmic · Linear or n log n
- O(n²)quadratic · Polynomial
- O(2ⁿ)exponential · Exponential or factorial
- O(n!)factorial · Exponential or factorial