PriorityQueue
Vitaly Davidovich
vitalyd at gmail.com
Thu May 14 15:35:47 UTC 2015
What I mean is what could the PQ do more efficiently with your Collection
vs you manually add()'ing each method? Are you looking to exploit the same
behavior in its PriorityQueue(Collection), i.e. add and then heapify in
bulk? initElementsFromCollection() doesn't seem all that efficient in the
first place if one were to invoke this on fast paths.
On Thu, May 14, 2015 at 11:27 AM, Brett Bernstein <brett.bernstein at gmail.com
> wrote:
> I may not understand what static method you are suggesting. If you have a
> collection containing data and you wish to make it into a PriorityQueue
> using a Comparator, there is no efficient method at the moment (addAll
> doesn't work).
>
>
> On Thu, May 14, 2015 at 10:11 AM, Vitaly Davidovich <vitalyd at gmail.com>
> wrote:
>
>> What would be the intrinsic advantage of such a constructor? Why not a
>> simple static util method in your own code that emulates this?
>>
>> sent from my phone
>> On May 14, 2015 1:17 AM, "Brett Bernstein" <brett.bernstein at gmail.com>
>> wrote:
>>
>>> To whom this may concern:
>>> I believe the list of PriorityQueue constructors has a glaring omission
>>> that could be easily rectified. That is, there is no constructor that
>>> takes a Collection and a Comparator. What steps should I go through to
>>> get
>>> this suggested to be added to the class?
>>>
>>> Thanks,
>>> Brett Bernstein
>>>
>>
>
More information about the jdk9-dev
mailing list