priority queue java comparator lambda

Solutions on MaxInterview for priority queue java comparator lambda by the best coders in the world

showing results for - "priority queue java comparator lambda"
Hippolyte
21 Feb 2017
1PriorityQueue<Integer> pq =new PriorityQueue<>((x, y) -> Integer.compare(y, x));
2
3pq.add(10);
4pq.add(5);
5System.out.println(pq.peek());