Algorithms from zero
Thinking & complexity: free-recall review
Retrieval beats re-reading. For each prompt, say or write a full answer from memory before you open the model answer — the effort of pulling it out is what makes the idea stick.
Reconstruct the unit’s spine — why we count steps, what Big-O keeps and drops, the complexity-class ladder, the time-space tradeoff, and how constraints pick your approach — without looking back at the lessons.
- 01Why do we measure an algorithm by its growth rate (Big-O) instead of by its wall-clock time?
- 02State the rule for finding the Big-O of a step count, and apply it to 3n² + 100n + 50.
- 03How do you combine complexities for sequential code versus nested loops, and why is the difference so large?
- 04Name the common complexity classes from fastest to slowest and where the practical cliff is.
- 05Explain the time-space tradeoff with the duplicate-detection example, and how you decide which side to take.
- 06How does the input constraint n tell you which complexity to aim for, with one worked example?
If you could reconstruct each answer from memory, you hold the unit’s spine: we measure growth not wall-clock; Big-O keeps the dominant term and drops constants; sequential phases add while nested loops multiply; the class ladder runs O(1) to O(n!) with the practical cliff at O(n²); time and space trade against each other and the binding constraint decides; and the input bound n maps straight onto the complexity you must hit. Estimate the cost before you run anything.