Stephen Colebourne wrote:
From: "Phil Steitz" <[EMAIL PROTECTED]>

Stephen Colebourne wrote:
> Given a choice I would deprecate PQ altogether.
That would make things simpler.

If no one else comments, I'll do this.



I am +1 on renaming to PriorityBuffer.

Done


I was also looking at the heap impl and wondering if the compare method
could check for ascendingOrder, then removing the need for near duplicate
methods (one for minHeap, one for maxHeap) elsewhere. Would this be a good
change?

That would simplify the code, but might cost something in overall performance (since compare is "hot"). Could be that's why the original author(s) set it up the way it is? Should be trivial. Might be worth playing with.


Another solution would be to just have the constructor reverse the comparator for maxHeaps (using ComparatorUtils.reversedComparator). There the cost would be stack operations for each compare (calling through to the reversed comparator).

Another (small?) consideration is backward compatability for anyone who has subclassed BinaryHeap (assuming we are not going to deprecate), since all of the percolateXxx methods are protected, not private.

Phil

Stephen



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to