Question: 5. (20 marks) Max heap implementation. A max heap is a data structure that supports at least three basic operations deleteMax and insert in O(logN),
5. (20 marks) Max heap implementation. A max heap is a data structure that supports at least three basic operations deleteMax and insert in O(logN), and findMax (returns the maximum element) in O(1). The structure is identical to a binary heap, but the heap order property is that for any node, X, the element stored at X is larger than or equal to the elements stored in its two children. a. Please implement MaxHeap class template in MaxHeap.h. b. Please write an application program a4q5.cpp that contains main function. The main function, 1). creates a max heap with MaxHeap
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
