Pseudocode for N-Queens
repeat these steps
- if there are no conflicts with the queens...
- else if there is a conflict and there is room to shift the current queen rightward...
Move the current queen rightward,
adjusting the record on top of the stack
to indicate the new position.