Question: Write a C++ program to implement the insert, delete and print function for a max heap. Read operation codes from a .dat file. The operation
Write a C++ program to implement the insert, delete and print function for a max heap. Read operation codes from a .dat file. The operation code are: I is to insert; D is to delete, and P is to print the contents of the heap. The operation code of I will be followed by a number to insert. Each operation code and value, when given, will be on separate line in the file. Continue inserting and printing values until the file is empty. When the file is empty, call the print function and then terminate the program.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
