priority queue doesn't insert in ascending order

前端 未结 0 858
青春惊慌失措
青春惊慌失措 2021-01-04 16:21

I was trying to insert the integers in PriorityQueue:

However, the output I am getting is not in sorted order. Output after running the below code is : [1, 5, 2, 8]

相关标签:
回答
  • 消灭零回复
提交回复
热议问题