// Driver.java for heap lab. // Let's practice using heap operations, especially: insert(value), removeMin() public class Driver { public static void main(String[] args) { Heap h = new Heap(); // Let's create an array of values to put in the heap. // From time to time, experiment with a different set of // input values, anywhere from 0 to 31 elements. int [] values = { 52, 45, 22, 90, 80, 10, 62}; System.out.printf("*** Test insert. ***\n"); for (int i = 0; i < values.length; ++i) { h.insert(values[i]); // inserting values[i], not i System.out.printf(h.toString()); } System.out.printf("*** Test delete. ***\n"); while (! h.isEmpty()) { h.removeMin(); System.out.printf(h.toString()); } } }