PriorityQueue

Dawid Weiss dawid.weiss at gmail.com
Thu May 14 07:03:09 UTC 2015


> You may have trouble finding someone with the same enthusiasm for this constructor as yourself.

This probably applies to many data structures that have specific (and
rare) applications. A priority queue that takes a custom comparator
seems like a pretty frequent (algorithmic) use case to me, however
(and so does a
limited capacity queue).

As an example, you can see the implementation of such a PQ in Apache
Lucene -- it is used all over the place [1].

Dawid

[1] https://github.com/apache/lucene-solr/blob/trunk/lucene/core/src/java/org/apache/lucene/util/PriorityQueue.java#L75-L79


On Thu, May 14, 2015 at 8:21 AM, Martin Buchholz <martinrb at google.com> wrote:
> On Wed, May 13, 2015 at 11:17 PM, Brett Bernstein <brett.bernstein at gmail.com
>> wrote:
>
>> I believe the linked sequence of messages refer to the addition of a
>> PriorityQueue constructor only taking a Comparator which was does appear in
>> Java 1.8.  Did you have a link to something regarding the a constructor
>> taking a Collection and a Comparator (2 arguments)?
>>
>
> Oops - you are right...  The one I referenced did get added, and your
> constructor is still missing.
> You may have trouble finding someone with the same enthusiasm for this
> constructor as yourself.



More information about the core-libs-dev mailing list