CSE373 Data Structures Wi07, Homework 6

Due online Thursday, 3/1/07, at 11 pm.
No late assignments will be accepted.

This assignment devleops a graph implementation that we will use for more complex graph algorithms in the final assignment, next week.

As usual, your code should not only work properly, but it also should be high-quality. In particular:

I. Graph Representations

The assignment has several files provided:

Fill in the remaining code for AdjListGraph.java, and Edge.java. Your code should be efficient and must have the minimal big-Oh possible for the given implementation.

II. Priority Queue

Starter files for this part of the assignment are also provided:

Implement the methods in HeapPriorityQueue.java to create a priority queue using a binary heap. Notice that this version of the queue contains a method that can be used to change the priority of an object that is already in the queue. You can use a sequential search to locate the item to be adjusted. Once you've changed the priority of an item in the queue, you need to move it to the proper place in the heap (i.e., reestablish the heap property). Other, faster implementations of a priority queue with changable priorities exist, but this will be sufficient for our purposes.