Ch 1 · Thinking Like a Computer Scientist · Data Structures & Algorithms

Topic 1 of 10 in Data Structures & Algorithms — Foundations — 3 lessons.

What Are Data Structures & Algorithms?

Every useful program does two things: it stores information and it processes it. Those two jobs have names.

Big-O: Measuring the Cost

When we ask "is this fast?", we do not mean seconds on your laptop — we mean: as the input grows, how fast does the work grow? That is Big-O notation.

Why O(n²) Will Hurt You

A loop inside a loop usually means O(n²) — and that scales badly. With 1,000 items that is 1,000,000 steps; with 1,000,000 items it is a trillion. The code below finds a duplicate two ways so you can feel the difference.

All topics in Data Structures & Algorithms Beginner

  1. Thinking Like a Computer Scientist
  2. Arrays & Lists — The Workhorse
  3. Stacks — Last In, First Out
  4. Queues — First In, First Out
  5. Linked Lists — Nodes on a Chain
  6. Searching — Finding the Needle
  7. Sorting — Putting Things in Order
  8. Recursion — Functions That Call Themselves
  9. Hash Tables — Instant Lookups
  10. Mini-Projects & Practice