This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma 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