Loading algorithms…
Loading visualizer…
Place N queens on an N×N board so none attack each other. The canonical backtracking example — try, conflict, undo, retry.
4 total solutions exist for N=6 · showing the first search path
6×6 board. Place one queen per row so no two share a column or diagonal. Starting from row 0.
Slide N from 4 to 8 · Red ✕ marks attacked squares · Backtracking undoes dead ends automatically
Place N queens on an N×N board so none attack each other. The canonical backtracking example — try, conflict, undo, retry.