Big-O: Measuring Speed
Before learning any data structure, you need the vocabulary for comparing them. Big-O notation describes how an algorithm's work grows as its input grows — the single most useful idea in this track.
Timing code in seconds is fragile: a faster laptop changes the number, a bigger input changes it more. Big-O ignores the machine and asks one question — when the input gets 10× bigger, how much more work happens? If the work also grows 10×, that's O(n), linear. If it grows 100×, that's O(n²), quadratic. If it barely grows at all, that's O(log n) or O(1). The letter n is the input size: items in a list, characters in a string, users in a database.
The common classes, fastest to slowest: O(1) constant, O(log n) logarithmic (halve the problem each step — binary search), O(n) linear, O(n log n) the best sorting can do in general, O(n²) quadratic (nested loops over the same data), O(2ⁿ) exponential (try every combination — hopeless past ~30 items). Big-O drops constants and small terms: O(2n + 5) is just O(n), because for large n the multiplier stops mattering compared to the growth shape.
Practical habit: whenever you write a loop inside a loop over the same data, pause and ask if a set or dictionary could remove the inner loop. That one reflex converts more O(n²) code to O(n) than any other trick.