6.S095 | January IAP 2018 | Undergraduate

Programming for the Puzzled

Puzzle 6: A Profusion of Queens

Can you place N queens on a board with N columns and N rows so no two queens threaten each other? The 8 queens problem on a chessboard is a special case. Prof. Devadas describes a general solution to the N queens problem that uses recursive backtracking search.

Puzzle Description

Python Code

Assignment

  • Do one or more of the exercises in A Profusion of Queens puzzle.

Solution

Programming Constructs and Algorithmic Paradigms Covered in this Puzzle

  • Recursive procedures
  • Exhaustive search through recursion

Course Info

Instructor
As Taught In
January IAP 2018
Learning Resource Types
Lecture Videos
Programming Assignments with Examples