I took a look at the solution of Problem 11.3. I think there is a problem, PriorityQueue doesn’t have a remove() method. I think it should’ve been a poll().
(Java) Problem 11.3
Hey Bogdan,
Please take a look at
https://docs.oracle.com/javase/7/docs/api/java/util/PriorityQueue.html#remove(java.lang.Object). remove() and poll() are very similar but we choose remove since it won’t return null if there is no object in the priority queue.
0 Likes