Java Priority Queue

  • + 1 comment

    Hello silverdust,

    I tried your suggestion, that is, I have implemented Comparable and Comparator at the Student class, as well as the mandatory methods of these 2 interfaces.

    Also, I have instantiated the priority queue passing the student as an argument (the Comparator of the queue).

    I could add the students to the queue and poll them from it. But, when I tried to print the names in list, the tests 3 and 5 have failed.

    Any idea, my friend?

    Best regards.