Making a Java PriorityQueue into a stable priority queue

前端 未结 3 1200
鱼传尺愫
鱼传尺愫 2020-12-11 06:58

I\'m trying to implement a stable (first in first out) priority queue in Java. Supposing that the key is a name and the value is an age, I know I can make an unstable prior

3条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-11 07:57

    Keap-based PriorityQueue is naturally stable. It's written in Kotlin, so it can replace java.util.PriorityQueue in Java code.

提交回复
热议问题