Start here · Essential guide
Big O for Data Structures
A practical guide to Big O for data structures: how arrays, lists, hash tables, trees and heaps compare on search, insert and delete costs, with examples.
Complexity and Computability
What Big O measures, how common data structures compare and whether it always means worst case.
Start here · Essential guide
A practical guide to Big O for data structures: how arrays, lists, hash tables, trees and heaps compare on search, insert and delete costs, with examples.
Big O is not always about the worst case. Learn what Big O measures, how best, average and worst cases differ, and when each one matters in practice.
Compare the two growth rates with real numbers, see where the log factor hurts, and learn why sorting is benchmarked at n log n. O(n) vs O(n log n) explained.
Big O in Python explained: the cost of list append, insert, membership tests, set and dict lookups, sorting and deque operations, with code examples.
What does the O in Big O stand for? It traces to the German word Ordnung, meaning order. Here is the history of the notation and what the letter means.
Related topics