Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

min priority queue in java

PriorityQueue<Integer> pq = new PriorityQueue<Integer>(defaultSize, new Comparator<Integer>() {
    public int compare(Integer lhs, Integer rhs) {
        if (lhs < rhs) return +1;
        if (lhs.equals(rhs)) return 0;
        return -1;
    }
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #min #priority #queue #java
ADD COMMENT
Topic
Name
2+7 =