This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: 15-121: Introduction to Data StructuresFall 2009Exercise10/04/2009Stacks PracticeDue: none Assignment: (worth 0 exercise points - this is for practice only) 1)Maze.Write a program that reads the description of a maze from a file. The maze is a two dimensional grid of Xs and Os. Xs are walls and O's are the path. The program should then search for a path through the maze and display the list of moves that should be made to get through the maze. The answer path should not repeat itself.It is up to you to determine how to signify beginning and end of the maze.2) Make modifications to the N-Queensproject looked at in class.Modify the program to add more pruning.before doing the recursion, check to see if the current set of queens is acceptable. If not, don't recurse.in deciding the possible set of queen locations, do NOT return all N^2 locations. In particular, consider the following:no sense in trying to put a queen on top of another existing queenif the previous queen is in row...
View Full Document
- Spring '09
- Data Structures