reset password
Author Message
dtang9
Posts: 52
Posted 10:55 Oct 26, 2018 |

To sort the list, I don't know how to use Comparator to sort it. Are we allowed to use PriorityQueue with Comparator instead?

jhurley
Posts: 207
Posted 16:22 Oct 26, 2018 |
dtang9 wrote:

To sort the list, I don't know how to use Comparator to sort it. Are we allowed to use PriorityQueue with Comparator instead?

Yes, that is what I meant.  See the sample code that creates a PQ using a Comparator.