1 write a c program called heap cpp to implement the heap algorithm the heap should 5346947
1. Write a C++ program called heap.cpp to implement the heap algorithm. The heap should be implemented in an array that can hold up to 250 elements. The following presents a sample run. (THIS PROGRAM MUST USE HEAP ALGORITHM)
Enter the number of elements: 6
Enter 6 elements: 2 9 7 6 5 8
Heap constructed: 9 6 8 2 5 7
Select Option (1: Insert, 2: Delete Max, 3: Exit): 1
Enter a new element to be inserted: 10
Updated heap: 10 6 9 2 5 7 8
Select Option (1: Insert, 2: Delete Max, 3: Exit): 2
Updated heap: 9 6 8 2 5 7
Select Option (1: Insert, 2: Delete Max, 3: Exit): 2
Updated heap: 8 6 7 2 5
Select Option (1: Insert, 2: Delete Max, 3: Exit): 3
Bye