← Back

πŸ‘‘ Royal Chess Battle

N-Queens - Backtracking Visualization

Board Size

8

Queens Placed

0

Current Row

0

Backtracks

0

Solutions

0
Solutions Found: 0
Select board size and start solving!

πŸ“– N-Queens Problem

Goal: Place N queens on NΓ—N board so no two attack each other

Backtracking: Try placing queen in each column of current row

β€’ If safe, move to next row

β€’ If no safe position, backtrack to previous row

Time: O(N!)