This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
PQsort pqs = new PQsort(); Priorityqueue<Ingeger> pq2 = new priorityqueue<Integers>(10,pqs);
Creates a PriorityQueue with the specified initial capacity that orders its elements according to the specified comparator.
initialCapacity - the initial capacity for this priority queue. comparator - the comparator used to order this priority queue. If null then the order depends on the elements' natural ordering.
the 2nd parameter in the priorityqueue constructor invokes the compare of method. (which happens behind the scene) what arguments are passed inside compare of method? say here public int compare(Integer one, Integer two) what one and two holds? can anyone explain
This might not completely answer your question, but it should suggest an approach to investigating questions like this. [ July 02, 2007: Message edited by: marc weber ]
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer sscce.org
aslika bahini
Ranch Hand
Joined: Mar 03, 2007
Posts: 111
posted
0
ObjectArrayPriorityQueue(int capacity, Comparator c) Creates a new empty queue with a given capacity and comparator.
Is the above one is same as this priorityqueue(int capacity, Comparator c)?