Final Practice Quiz - Graphs
-
Make sure that you are in the quizspace.
-
While practicing this quiz, Do not:
-
use other labs or assignments
-
interact with other students
-
use the internet
-
use personal devices
-
-
Create a
PQ5
project and import PQ5-starter.jar.
Your directory should look like this:
PQ5/ └── src └── PQ5.java
-
Read over the
main
method which has anArrayList<Nodes>
created by thebuildGraph()
method-
The nodes in the graph are connected in a manner similar to a ternary tree, with a left, center, and right reference.
-
You should not modify the test code in main or the buildGraph() method.
-
-
Add a field of type boolean to the Node class to keep track of whether or not the node has been visited
-
Implement the depthFirst() method. Test your code using the main method. If you have followed the directions correctly the letters will spell a message.
Warning
|
Do not hardcode anything, we will test your program using a completely different graph! |
Once complete, submit PQ5.java
to Checkin.