What Even Are Algorithms & Data Structures? (Spoiler: You Use Them Every Day)
Let’s start with the one that sounds way scarier than it actually is: algorithms. If you’ve ever heard people say “algorithm” in tech bro podcasts or math class and immediately zoned out, you’re not alone. But here’s the secret no one tells you: you’ve been writing and using algorithms your entire life, even if you never wrote a single line of code. An algorithm is just a step-by-step set of rules to solve a problem. That’s it. No fancy math, no complicated jargon, just a list of steps you follow to get from point A (a problem) to point B (a solution).
Think about your morning routine before school. If you want to get out the door in 10 minutes without forgetting anything, you probably have a fixed set of steps you follow without even thinking: 1. Swap your pajamas for your school uniform. 2. Pack your backpack with the books and worksheets for today’s classes, following your class schedule. 3. Brush your teeth for 2 minutes. 4. Grab your student ID and house keys from the hook by the door. 5. Put on your shoes and head out. That whole routine? That’s an algorithm. It has three core rules that all algorithms follow, even the super complex ones that run TikTok or SpaceX rockets: 1. Determinacy: Every step is clear and unambiguous. You don’t have a step that says “brush your teeth until they feel clean” — that’s vague, and you might end up brushing for 10 minutes and miss the bus. You have a fixed 2-minute timer, so the result is predictable every time. 2. Input and output: Every algorithm has something you put into it (input) and something you get out of it (output). For your morning routine, the input is you, your uniform, your school supplies, and your schedule. The output is you arriving at school on time, with everything you need. 3. Finiteness: The number of steps is limited. You don’t have an infinite loop of “brush teeth → drink water → go to bathroom → brush teeth again” that never ends. If you did, you’d never make it to first period.
You can test this yourself: if you mess up one step of your morning algorithm, the whole thing falls apart. Forget your student ID? You can’t get into school. Forget your math homework? You get a zero. Even tiny changes to the steps can have huge consequences: if you swap “brush teeth” and “put on shoes” in your routine, you’ll end up with toothpaste on your new sneakers, and your mom will yell at you. That’s algorithm design in real life.
Now let’s talk about what happens when you use a bad algorithm. Let’s say your current morning routine is: 1. Brush your teeth. 2. Change into your uniform. 3. Eat breakfast. 4. Pack your backpack. Sounds fine, right? But