Index

Free, with Google

Keep going, free.

A free account opens lessons 2 and 3 of every track, 33 more lessons, and keeps your progress and review cards on every device.

Start free with Google

A chalk plan

Open everything on chalk.

Every lesson, board, video, lab and paper, and the full review decks. Yearly is $39/year.

See plansStart free instead

Module 02 · DSA · Choosing the attack · about 22 min to read

Play it as a journeyTutor comes with a plan

Break your own answer: edge cases and stress tests

Recursion and Dynamic Programming
Recursion and Dynamic Programming · Open board

Shows recursion as calls stacked on top of each other, each waiting for the one above it. This lesson breaks that stack on purpose, then rebuilds it by hand.

Before you start. Why the loop is right gave you the loop invariant, a sentence that stays true on every lap, and showed that tests on easy examples pass while boundary bugs hide. Recursion & Dynamic Programming gave you recursion, a function that calls itself on a smaller problem until a base case answers directly. Linked Lists, Stacks & Queues gave you the stack, where the last item in is the first one out, and the call stack, the list of calls that have started and not finished. Complexity & Big-O gave you the habit of counting steps as the input grows.

Lesson 13 of 96 in DSA

The rest of this lesson is part of a plan.

A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year.

See plansAlready a member? Sign in

Or start free: a free account opens lessons 2 and 3 of every track.

In this lesson

  • 2015: a sort that sorted correctly and still crashed
  • Edge cases: the inputs at the boundary
  • Stress test: let a slow, obviously right program find the bug
  • Explicit stack: when recursion runs out of room
  • Space complexity: a second question after time
  • Designing a stress test that finds things
  • Recursion to an explicit stack: in-order, post-order, and what changes
  • Space complexity measured
  • In an interview

Terms it explains: edge case, brute force, stress test, shrinks, call stack, explicit stack, Space complexity, Common mistakes, The generator, The brute force, The comparison, The seed, 18, 10, base case, dynamic programming, greedy, knapsack / edit distance / LCS, memoization, optimal substructure, overlapping subproblems, recurrence, recursion, recursion tree, rolling array, state, tabulation, time, Viterbi.

Review DSA