Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

java priority queue

807603Nov 26 2007 — edited Dec 6 2007
Java provides PriorityQueue, and I have gone through its API.
The implementation of PriorityQueue in Java does not provide method for increase or decrease key,
and there must be a reason for it.

But, when i go through books on data strucutre, a lot of them talk about the increase/decrease key function
of the PriorityQueue.

So I am just wondering, why is it that increase/decrease function not provided in PriorityQueue. I cannot come up with a reason for it, but i think there must be. Does anybody have any thought on this. Or is it just
because the designers thought its not needed?

I checked the source for the Priority Queue and the heapify() method was declared private.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 3 2008
Added on Nov 26 2007
6 comments
501 views