Check out example codes for "min heap in c++". It will help you in understanding the concepts better.

Code Example 1

priority_queue <int, vector<int>, greater<int>> minHeap;
priority_queue <int> maxHeap;

Code Example 2

#include<queue>
std::priority_queue <int, std::vector<int>, std::greater<int> > minHeap;

Code Example 3

priority_queue <int, vector<int>, greater<int>> minHeap;

Learn ReactJs, React Native from akashmittal.com