solulubeta
Sign in
Recursion & Memo / Choices and backtracking
02.01 · Lesson

Draw the Tree: Pick or Skip

Most recursion questions are a list of choices. Draw the choice tree for a tiny input, read the state and the base case from it, then write pick-or-skip code. One tree answers four kinds of questions.

10 min 1 video Quiz Pro

Most recursion questions in tests are a list of choices: take this item or not, go left or right. The best habit: draw the tree for a tiny input before you write code.

Example: all subsets of [1, 2]

For each number there are two choices: pick it or skip it.

solulu Pro

Continue this lesson with Pro

Inside: 5 sections · 1 video · quiz.

  • Example: all subsets of [1, 2]
  • From the tree to the code
  • One tree, four questions
  • How big is too big?
  • Remember
Lifetime ₹1,999 ₹999 · Launch offer
Mark this as done when you are finished.

Item 12 of 44 · updated 2026-10-13