Final Practice Quiz - Graphs

  1. Make sure that you are in the quizspace.

  2. While practicing this quiz, Do not:

    • use other labs or assignments

    • interact with other students

    • use the internet

    • use personal devices

Getting Started
  1. Create a PQ5 project and import PQ5-starter.jar.

Your directory should look like this:

PQ5/
└── src
    └── PQ5.java
Instructions
  1. Read over the main method which has an ArrayList<Nodes> created by the buildGraph() 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.

  2. Add a field of type boolean to the Node class to keep track of whether or not the node has been visited

  3. 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!
Submission

Once complete, submit PQ5.java to Checkin.