Start Learning
Javaneer
Back to roadmap
🧠
Stage 7

Recursion, Backtracking & DP

The hardest patterns, demystified.

Recursion, backtracking, and dynamic programming scare people - but they're one idea at three scales. Learn to generate all possibilities with backtracking, then to make overlapping recursion efficient with memoization and tabulation.

5 Lessons in this stage1 h 19 min
Start the first lesson

Lessons in this stage

  1. 01

    Recursion, Deep

    Intermediate

    Base case and recursive case, the call stack, and how to trust and design a recursive solution instead of tracing it in your head.

    14 min
  2. 02

    Backtracking

    Advanced

    Systematically build and abandon partial solutions to generate subsets, permutations, and combinations - and to solve constraint puzzles like N-queens.

    17 min
  3. 03

    Introduction to Dynamic Programming

    Advanced

    Overlapping subproblems and optimal substructure: turn exponential recursion into polynomial time by remembering answers (memoization).

    16 min
  4. 04

    1D Dynamic Programming

    Advanced

    The classic starter DPs - climbing stairs, house robber, coin change - and how to define a state and a transition.

    16 min
  5. 05

    2D Dynamic Programming

    Advanced

    Grid paths, longest common subsequence, and the knapsack - building a table where each cell depends on earlier ones.

    16 min