◐ ai-teacher

🧩 Free course

Data Structures & Algorithms

See every core data structure and algorithm move, then solve the interview problems built on them.

Start the course free →

What you will learn

  1. Big-O: how fast code grows
    Two programs both take one second on 1,000 items. On a million items, one takes about 17 minutes and the other takes eleven days. Big-O tells you which is which before you run either.
  2. Arrays and strings
    Reading item 900,000 of an array is as fast as reading item 0. Inserting a new item at the front means moving all 900,000 others. Both facts come from the same design.
  3. Hashing and hash maps
    A list makes you ask every item 'are you the one?'. A hash map computes where the answer lives and goes straight there — which is why it turns so many O(n²) solutions into O(n).
  4. Two pointers
    Checking every pair in a sorted list of 10,000 numbers is 50 million comparisons. Two fingers walking inward from the ends do it in under 10,000 — with no extra memory.
  5. Sliding window
    To move a 7-day window forward one day, you don't re-add all seven days. You add the new day and subtract the one that fell off. That one idea turns O(n·k) into O(n).
  6. Stacks
    Undo in your editor, the back button in your browser, and the way your program remembers where to return after a function call are all the same tiny structure: last in, first out.
  7. Queues and deques
    The print jobs on an office printer, the messages between two services, and breadth-first search through a map all need the same promise: whoever arrived first is served first.
  8. Linked lists
    An array keeps its items shoulder to shoulder, so squeezing one in moves everyone. A linked list keeps each item wherever it likes and just remembers who comes next — so inserting is rewiring one arrow.
  9. Recursion
    A function that calls itself sounds like a bug. Done right, it is the shortest correct answer to every problem shaped like a tree.
  10. Binary search
    A million sorted items, and you can find any one in 20 looks. The catch: get one +1 wrong and it loops forever.
  11. Sorting algorithms
    Every sort ends with the same list. What differs is how many comparisons it took, how much memory it borrowed, and whether equal items kept their order.
  12. Trees and binary search trees
    A binary search tree is binary search that you can insert into. Feed it sorted data, though, and it quietly turns into a linked list.
  13. Tree traversals
    Same tree, four walks, four different lists. Which one you pick decides whether you get sorted keys, a copy, a safe delete or a level-by-level view.
  14. Heaps and priority queues
    A heap never fully sorts anything. It just keeps the smallest item on top — and that lazy promise is exactly what schedulers, maps and top-10 lists need.
  15. Graphs: BFS and DFS
    BFS spreads like a ripple; DFS dives like a maze-runner. Same graph, same O(V + E) cost — but only one of them finds the fewest-stops route.
  16. Dynamic programming, from recursion
    Dynamic programming isn't a new algorithm. It's your slow recursive solution, plus a notebook so it never solves the same subproblem twice.

How the course works