[Solved] how do i implement heap data structure using c++? [closed]

Here is my simplest C++ implementation for heap. The code is well-commented. /* Usage: heap Heap; Heap.clear(); Heap.insert(value); Heap.remove(); Heap.print(); */ struct heap { int myarray[NN+1]; // myarray to store the numbers as heap, 1 indexed int n; // the number of nodes in my array heap() { // constructor clear(); // we clear the … Read more