How can I get the max element of a queue and how can I print it? Shoul I include it in pop function or I have to make another function for it?
3/24/2018 3:55:51 PM
Winter Soldier2 Answers
New AnswerIf you are able, you could keep information about your queue as you fill it. I would personally use a class for this. You could also find it the way you mentioned it - with pop(), but you will have to pop every element to find which one is the max.
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message