// Skeleton routine to HeapSort a vector of Integer values // Consider using a VectorHeap implementation of the PriorityQueue // interface. Note that the remove method removes the smallest // value from a PriorityQueue. Also, see discussion of HeapSort // on page 222 of your text. import structure.*; public class VectorHeapSort { public static void heapSort(Vector data, int n) // pre: 0 <= n <= data.length // post: values in data[0..n-1] are in ascending order { int i; PriorityQueue w = new VectorHeap(); for (i=0; i