I have a problem with stl priority queue.I want to have the priority queue in the increasing order,which is decreasing by default.Is there any way to do this in priority qu
You can use comparator class/struct to achieve the same in priority queue.
class CompareHeight { public: bool operator()(int &p1, int &p2) { return p1 > p2; } };
Now declare the priority queue as
priority_queue, CompareHeight> pq;