Just Use Priority Queue in Java


#1

using priority queue for sorting works here