Algorithms / 3 visualizations
Backtracking Visualizers
Choose, explore, un-choose: subsets, permutations and N-Queens.
Open the lab → Every one runs on your own input, step by step, with the code highlighted in Java, Python, C++, C or JavaScript. Free, no sign-up.
All backtracking visualizations
- SubsetsO(n·2ⁿ)
For each value, make a choice: include it or skip it. Go deeper, then undo the choice and try the other branch.
- PermutationsO(n·n!)
Fill the answer one position at a time. At each position try every value not used yet, go deeper, then give the value back so the next branch can use it.
- N-QueensO(n!)
Place one queen per row. Try each column. If it is safe, move to the next row. If no column works, backtrack and move the previous queen.