CSci 2101 Lab 12. April 26.

40 points

Due Monday, May 2nd.

Work in pairs on this lab.

Finish the graph implementation that you started on Friday. You will need to add testing code and the implementation for breadth-first and depth-first traversals and the shortest path algorithm.

Feel free to use the predefined Java classes LinkedList (essentially, a queue), Stack, and PriorityQueue for breadth-first search, depth-first search, and the shortest path method, respectively. The standard priority queue is impelmented as a priority heap so it has log N efficiency for both addition and removal. Alternatively feel free to use your own. Note that you would need to either make objects that you are putting into the queue Comparable, or provide a Comparator (also see the Comparator API). I recomemnd the latter approach.

How to submit

Submit the java file(s) with your testing code by e-mail to me. The subject of the message must be 2101 Lab 12. Make sure to CC your group partner(s).


CSci 2101 course web site.

The views and opinions expressed in this page are strictly those of the page author. The contents of this page have not been reviewed or approved by the University of Minnesota.