Java PriorityQueue with fixed size

后端 未结 7 1078
梦毁少年i
梦毁少年i 2020-12-02 18:38

I am calculating a large number of possible resulting combinations of an algortihm. To sort this combinations I rate them with a double value und store them in PriorityQueue

7条回答
  •  执念已碎
    2020-12-02 19:09

    There is a fixed size priority queue in Apache Lucene: http://lucene.apache.org/java/2_4_1/api/org/apache/lucene/util/PriorityQueue.html

    It has excellent performance based on my tests.

提交回复
热议问题