How the program works
p
The program
uses a stack to
keep track of
where each
queen is placed.
I want to show you the algorithm that the program uses. The technique is called
backtracking
. The key feature is that a
stack
is used to keep track of each placement of a queen.