Question: Implement a min binary heap in C++ code using arrays containing the following functions. ifEmp will return 1 if heap is empty otherwise zero showSize
Implement a min binary heap in C++ code using arrays containing the following functions.
ifEmp will return 1 if heap is empty otherwise zero showSize - method returns the number of elements in heap showHeight - will return the height of the heap constructHeap(array) - the method will convert any array of numbers to heap Output - this will print the heap MIN - would return min element RemoveElement - Removes the min element from the heap and ensures that the heap is arranged accordingly. InsertElement - Inserts the number into heap and ensures that the new element is placed accurately so that heap maintains its properties
Make sure the code is well commented and easy to understand. Please try to solve it fast. Thanks.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
