Which is the best Data Structure for Heap implementation and Why ?
1 Like
I don’t about other languages, but in C++ you can use priority queue to create a minheap or a maxheap.
To create a max heap of integers, just type:
**priority_queue<int> maxheap;**
To create a min heap of integers, just type:
**priority_queue<int,vector<int>,greater<int> > minheap;**
In the second case, remember to
#include<utility>