Expand|Select|Wrap|Line Numbers
- int main ()
- {
- BinaryHeap pQueue; // create empty heap
- bool acceptCommand = true;
- string command; // function to perform
- while (acceptCommand)
- {
- // get function to perform
- cout << "Please enter a command: " ;
- cin >> command ;
- cout << endl ;
- // act accordingly
- if (command=="createHeap")
- {
- ...
- }
- else if (command=="insert")
- {
- ...
- }
- else if (command=="deleteMin")
- {
- ...
- }
- else if (command=="deleteHeap")
- {
- ...
- }
- else if (command=="remove")
- {
- ...
- }
- else if (command=="decreaseKey")
- {
- ...
- }
- else if (command=="quit")
- {
- acceptCommand = false;
- }
- else // invalid command
- {
- cout << "Command not recognized. Please try again." ;
- }
- } // end while
- return 0;
- }