Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

priorityQueue peek java

PriorityQueue<Integer> pq = new PriorityQueue<>();
pq.add(2);
pq.dd(1);
pq.add(0);
pq.add(5);

System.out.println(pq.peek());    // gives the smalles int i.e. 0;
 
PREVIOUS NEXT
Tagged: #priorityQueue #peek #java
ADD COMMENT
Topic
Name
7+5 =