Algorithms

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 ___.

Lessons that use it

More algorithms terms

All terms →

Arki, the beaver mascot

Your next interview starts with 5 minutes today.

Free on iOS and Android. Start from zero, no account needed.