We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
List stdLst = new ArrayList<>();
students.forEach(student -> stdLst.add(student));
seem like u are misunderstanding with prioirtyqueue. Prioirtyqueue doesn't care about the order in the whole queue but the smallest element in front of the queue. So if you do this, elements in the queue(except the first element) can't be in the require order
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Java Priority Queue
You are viewing a single comment's thread. Return to all comments →