Given the class definitions below, complete the code for the empty, swap and push functions.( thats Heap.
Fantastic news! We've Found the answer you've been seeking!
Question:
#include #include using namespace std; class heapType{
public: bool empty(); void push(int num); heapType();
private: int C1I; int C2I; int CI; int done; // status flag int EOL; // end of line int count; // elements in the heap int heap[10];
int PI; // parent index
void swap(int I1,int I2); // exchange heap contents };
// ----------------------------------------------------- bool heapType::empty(){
... complete the code here ...
} // ----------------------------------------------------- void heapType::swap(int I1,int I2){ // exchange heap contents
... complete the code here ...
} // ----------------------------------------------------- void heapType::push(int num){
... complete the code here ...
// child 1 index // child 2 index // child index
}
Related Book For
Introduction to Data Mining
ISBN: 978-0321321367
1st edition
Authors: Pang Ning Tan, Michael Steinbach, Vipin Kumar
Posted Date: