Representing and Storing Data: 8 Queens

6.8. Representing and Storing Data: 8 Queens#

When taking an algorithm and implementing it in code, it’s important to think about what data the program will need to store and how it will store it.

Question 1

To solve the 8 queens problem, we’ll need a way to store the chessboard configurations. Describe how you might do this. You should also provide a concrete example for how

Board A

../../_images/5_queens1.png

and Board B

../../_images/5_queens2.png

would be represented in your system.

Solution

Solution is locked

Question 2

Consider a program that implements backtracking to solve the 8 queens problem. Can you come up with a list of all the data you would need to store in your program?

Solution

Solution is locked

Question 3

Create a data dictionary for all of the variables you would need to create when implementing backtracking to solve the 8 queens problem.

Variable Name

Data Type

Size in Bytes

Description

Example






Solution

Solution is locked