iq.lab
Python starts when a code cell comes near or you run one

Module 11 · 2 lessons · about 4 hours 5 minutes

Backtracking

The choice tree behind subsets and permutations, the choose-explore-unchoose template, and pruning branches that cannot work.

Lessons
0/2
Exercises
0/16
Code
0/2
Problems
0/9
Checkpoint
Not taken

Already comfortable with this? Take the checkpoint cold. If you pass, move on and come back only for what you missed.

  1. 1The choice treeEvery subset is a path of keep-or-drop choices, and every ordering a path of "which unused item next". Walk that tree depth first with one shared list, choosing, exploring and unchoosing at every box, and you can list every answer exactly once.1 h 50 min
  2. 2Pruning and constraintsMost choice trees are full of branches that are broken from their first wrong step. Test every choice before you make it, and the search never builds what cannot become an answer.2 h 15 min
  3. Checkpoint11 questions. Pass with 80% to finish the module.

Problems for this module

The lessons teach some of these step by step (each says which). The rest are practice: try each in its target time, and solved problems come back for spaced re-solves.

Next moduleDynamic programming