Thread: [Java] Priority Queue
hi,
i'm developing project (i think it's called "evolutionary programming" in english) has class named "individual", attribute named "confort".
want project have top5 of individuals higher confort. top5 must refreshed frequently, , must able access 1 individual higher confort.
thinking implementing priorityqueue, one:
priorityqueue(int initialcapacity, comparator<? super e> comparator)
initialcapacity = 5;
question is: happens if queue full , add individual? queue drop individual lower confort? (i hoping so...)
if not work, how suggest it?
in advance
http://docs.oracle.com/javase/6/docs...rityqueue.html
"a priority queue unbounded, has internal capacity governing size of array used store elements on queue. @ least large queue size. as elements added priority queue, capacity grows automatically. details of growth policy not specified."
how can queue full?
Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk [Java] Priority Queue
Ubuntu

Comments
Post a Comment