#include using namespace std; #include "Heap.h" #include "test_utilities.h" int main(int argc, char *argv[]) { test_init(20, argv[0]); // test basic operations Heap H; test(1, H.size() == 0, "new Heap should have size() == 0"); H.insert("eight", 8); H.insert("one", 1); H.insert("three", 3); H.insert("nine", 9); H.insert("seven", 7); H.insert("four", 4); H.insert("five", 5); H.insert("six", 6); H.insert("two", 2); for (int j = 0; j < 5; ++j) { char *c; int i; H.delete_min(c, i); cout<< c << ", key " << i << endl; } H.insert("NINE", 9); H.insert("SEVEN", 7); H.insert("FOUR", 4); H.insert("FIVE", 5); while (! H.empty() ) { char *c; int i; H.delete_min(c, i); cout << c << ", key " << i << endl; } }