// Course: CS 14 // Lecture Section: 001 // Lab Section: Enter your lab section number here (21, 22, etc) // Assignment #: LAB 8 // First Name: Enter your FIRST name here (eg, John) // Last Name: Enter your LAST name here (eg, Doe) // ID Number: Enter your ID number here (eg, 12-345-678) // Email address: Enter your UCR email address here (eg, jdoe@cs.ucr.edu) // =============================================================== #include #include "Heap.h" using namespace std; // read from console the tree values void storeHeapNodes(Heap& h) { int value; // node value cout << "\nEnter a positive value (negative value to stop): " ; cin >> value; while (value > -1) { try { h.heapInsert(value); } catch (std::exception &e) { std::cout << e.what() << std::endl; break; } cout << "\n\nEnter a positive value (negative value to stop): " ; cin >> value; } } int main() { Heap aHeap; storeHeapNodes(aHeap); return 0; }