An eccentric billionaire named Gil Bates constructed a large one-story mansion with a rectangular floor plan. What's odd about this mansion is that it has no hallways and the rooms are all the same size. There is only one door into the building, and each room is connected to its adjoining rooms with a door in the common wall. Draw a sketch of the building to help you figure out a data structure to represent the mansion. Assume the building is 7 rooms in the east-west direction by 5 rooms in the north-south direction and that the front door is in the middle of the south side. One point.
On any given day, some of the doors between rooms are locked and some are not. Draw a graph to represent the mansion on some day when 11 of the interior doors are locked. Let each node of the graph represent a room, and each edge in the graph represent an unlocked door. One point.
Code a definition of an abstract data type to represent a node in the mansion graph. You may use a struct or a class as you prefer. Hint: doors are usually two-way passages. Include in your ADT member data to represent whether or not an explorer has been in the room and whether or not the room contains the sought-after prize. Test your code with a main() function that instantiates one room. One point.
Finally, expand your main() function to build the 35-room mansion with all the doors unlocked and all the rooms marked as unvisited. Put the secret prize in one of the rooms and be sure to keep a pointer to the room with the front door. Two points.