Question
Project #4 Due Dates: Saturday, November 25 at 11:59pm Submit: eLearning Late Policy: -10 points per hour late Instructions: This is an individual assignment. All
Project #4 Due Dates: Saturday, November 25 at 11:59pm Submit: eLearning Late Policy: -10 points per hour late Instructions: This is an individual assignment. All work should be your own. Objective: Work with the Disjoint Set data structure. Overview: The Disjoint Set data structure will be used in the creation of a maze. The algorithm to do this is discussed in the textbook in chapter 8. Details: Write a program to generate and display a maze as described in the textbook. The program may either be a command-line program that generates a character-based maze, or it may be a GUI program that draws the maze in a window. The user should be able to specify the number of rows and columns in the maze, at least up to 20x20. You must use the DisjSet class from the textbook to implement the textbook's algorithm. The DisjSet class must be used as given in the textbook without making modifications to it. Since this problem is one from the textbook, it is likely that there are solutions on the Internet for it, however, you may not use solutions from the Internet in any way on this project. All work must be your own. Submit to eLearning: All your *.java files
8.7 An Application An example of the use of the union/find data structure is the generation of mazes, such as the one shown in Figure 8.25. In Figure 8.25, the starting point is the top-left corner, and the ending point is the bottom-right corner. We can view the maze as a 50-by-88 rectangle of cells in which the top-left cell is connected to the bottom-right cell, and cells are separated from their neighboring cells via walls. A simple algorithm to generate the maze is to start with walls everywhere (except for the entrance and exit). We then continually choose a wall randomly, and knock it down if the cells that the wall separates are not already connected to each other. If we repeat this process until the starting and ending cells are connected, then we have a maze. It is actually Figure 8.25
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started