Pruning
Cutting off a branch of the search as soon as you know it cannot lead to a solution, so you do not walk through all of it.
Example
If you look for combinations that add up to 9 and you are already at 10, there is no point in adding more: that branch is pruned.
Test yourself: Pruning
Backtracking
Cutting a branch as soon as you know it is useless is called ___.
If a node 3 has 50 nodes below it, pruning it saves 50 visits.
Permutations
To avoid choosing the same item twice, a list of booleans called ___ is used.
With [1, 2, 3], after choosing the 1, selected is [True, False, False] and the 1 is skipped.
Permutations
selected is ___ for the whole search; duplicated is new in each round.
With 3 items there is 1 shared selected and up to 3 duplicated at once, one per level.
0/3
â–¶ Play