The following code contains functions to implement a Max-Heap using a partially filled array, Fill the body of all funct
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
The following code contains functions to implement a Max-Heap using a partially filled array, Fill the body of all funct
The following code contains functions to implement a Max-Heap using a partially filled array, Fill the body of all functions: #include<iostream> using namespace std; static const int MAX_SIZE = 15; int heap[MAX_SIZE); int size=0; // index of the parent static int parent(int i) { } // index of the left child static int leftChild(int i) { } // index of the right child static int rightChild(int i) { } // insert the item at the appropriate position void insert(int data) } // returns the maximum item of the heap int getMax() { } // prints the heap void printHeap() { }
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!