Seconds depend on the reader's glasses; steps per page don't — so we measure algorithms by counting basic steps as a function of the input size n (Ch 1). For big inputs only the shape of the formula matters, like "per km" versus "per km²", so Big-O drops constants and smaller terms and places every algorithm on a ladder: 1, log n, n, n log n, n², n³, 2ⁿ, n! (Ch 2). The logarithm is "how many times can I halve it" — a thousand needs 10 halvings and a billion only 30, which is why binary search, balanced trees and heaps feel instant (Ch 3).
Reading code, sequences add and nested loops multiply; a halving loop is log n; different inputs keep different letters; and every
hidden loop inside a method call — contains, substring, + on strings — must be counted (Ch 4). We quote the worst case unless we say
otherwise, while knowing hash maps and quicksort are judged by their average (Ch 5). Memory is the second budget: space complexity, including
the call stack of every recursion (Ch 6). An occasional expensive step spread over many cheap ones — the ArrayList that copies everything when it
grows by 1.5× — is amortized O(1), 2.4 copies per add no matter how large (Ch 7).
Recursion is a chain message: two calls per call explodes into O(2ⁿ) — naïve Fibonacci's 30 million calls for n = 35 — until memoization
collapses it to O(n); and splitting in half with linear merging gives the n log n of merge sort (Ch 8). Java's everyday operations each have a
price to memorise — remove(0) was 100× slower than removing from the end (Ch 9). And the constraints in every problem, with ~10⁸ steps per
second, tell you which rungs of the ladder are even allowed before you write a line (Ch 10). Finally, constants, the cache and JIT warm-up remind you
that Big-O is the first question about speed, not the last (Ch 11).
Next, Collections, From the Inside opens up every data structure in that cost table, so you know why each operation costs what it does.