-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathinclassimp.java
More file actions
30 lines (27 loc) · 840 Bytes
/
inclassimp.java
File metadata and controls
30 lines (27 loc) · 840 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import java.util.PriorityQueue;
public class inclassimp
{
public static void main(String[] args) {
PriorityQueue<Integer> pq=new PriorityQueue<Integer>();
pq.add(2);
pq.add(1);
pq.add(4);
pq.add(9);
pq.add(6);
pq.add(3);
pq.add(5);
System.out.println(pq.size());
System.out.println(pq.isEmpty());
System.out.println(pq.poll());
System.out.println(pq.size());
System.out.println(pq.peek());
System.out.println(pq.size());
System.out.println(pq.poll());
System.out.println(pq.poll());
System.out.println(pq.poll());
System.out.println(pq.poll());
System.out.println(pq.poll());
System.out.println(pq.poll());
System.out.println(pq.isEmpty());
}
}