Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

priority queue java comparator lambda

PriorityQueue<Integer> pq =new PriorityQueue<>((x, y) -> Integer.compare(y, x));

pq.add(10);
pq.add(5);
System.out.println(pq.peek());
 
PREVIOUS NEXT
Tagged: #priority #queue #java #comparator #lambda
ADD COMMENT
Topic
Name
7+2 =