Combinatorics & Counting
"How many ways" questions tempt a direct answer: generate every arrangement, every selection, every
"How many ways" questions tempt a direct answer: generate every arrangement, every selection, every
The greatest common divisor looks like a problem for factoring both numbers and comparing their
Every algorithm folder so far has assumed arithmetic just works: a hash function combines numbers,
Testing whether a single number n is prime is a small, self-contained problem: try dividing it by
A deterministic algorithm has exactly one worst case, and if that worst case is realistic — an