Find a lesson, question or project

Start typing to search published content and planned structures.

↑ ↓ moveEnter openEsc close
01 / WHAT IT SOLVES

Naturally nested structures, divide-and-conquer work and decision trees.

02 / HOW TO RECOGNIZE IT
  • same task on smaller input
  • tree or directory structure
  • choose and continue
03 / PROTECT THIS INVARIANT

Each call owns one well-defined subproblem and moves closer to the base case.

04 / EXPECTED COST

Depends on branches and depth. Typical auxiliary space: At least O(depth) call stack.

JAVA STARTING POINT

A template to adapt, not memorize.

Java
static void solve(int index) {
    if (index == limit) return;
    solve(index + 1);
}

Common mistakes

  • Missing a base case
  • Not reducing the problem
  • Ignoring call-stack space

PUBLISHED / 41

Learn in this order.

Available articles always appear before the publishing plan.

PLANNED PRACTICE

What comes after the published lessons.

  1. Print from 1 to nPlanned, not yet published
  2. Generate valid parenthesesPlanned, not yet published