I need to store numbers in a queue in increasing order.
I used priority queue which stores higher value first, that is in decreasing order.
priority_queue<int>q;
Is it possible to order them increasing ?
What can i do to make the data order to be increasing ?
To store value in increasing order you just need to change the declaration of the priority queue :
priority_queue<int, vector<int>, greater<int> >q;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With