Algorithm Design & Complexity
📋 What it is
An ALGORITHM is a precise step-by-step recipe; its "Big O" complexity says how the work grows as the input grows.
🗣️ Coach says
An algorithm is just a clear recipe a computer can follow. Some are fast, some slow — and Big O notation compares how the work SCALES. A binary search (halving each time) finds a name in a million-entry list in about 20 steps, while checking one-by-one could take a million. Choosing the smarter algorithm beats a faster computer.
🧠 Memory hook
Algorithm = exact recipe. Big O = how the work GROWS with size. Halving (log n) crushes one-by-one (n).
😂 Giggle
What did the AND gate say to the OR gate?
"I'm more exclusive — BOTH inputs have to be true for me!"
😲 Whoa!
Binary search is why a phone can find one contact among millions the instant you start typing.
✅ Quick check: Searching a sorted list by halving the range each step is faster than checking every item. Why?
Say your answer out loud first — then reveal.
Halving throws away half the remaining items each step, so it needs only about 20 steps for a million.
Log-scaling (halving) grows far slower than checking all n items one by one.
🧪 Try it! (2 minutes)
Play "guess my number 1–100" — always guess the middle. Count how few guesses halving needs (about 7).