// File: TreeTest.cpp // Driver for Binary Tree ADT #include #include #include "Heap_ADT.h" using namespace std; typedef HeapADT TheHeap; int main() {TheHeap PriorityQ; int entry; char choice; do { cout << "Select: A)dd Element R)emove Element P)rint T)ree Print Q)uit\n"; cin >> choice; choice=toupper(choice); switch (choice) { case 'A': cout << " Enter an Integer >"; cout.flush(); cin >> entry; PriorityQ.insertToHeap(entry); break; case 'R': if (!PriorityQ.isHeapEmpty()) { PriorityQ.removeFromHeap(entry); cout << "Removed " << entry << endl; } else cout << "Queue Empty\n"; break; case 'P': cout << PriorityQ; break; case 'T': PriorityQ.heapPrint(); } } while (choice!='Q'); }