forked from jieli4970/Algorithm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHeapTest.java
More file actions
24 lines (17 loc) · 549 Bytes
/
HeapTest.java
File metadata and controls
24 lines (17 loc) · 549 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
import org.junit.Assert;
public class HeapTest {
@org.junit.Test
public void test() {
Heap<Integer> heap = new Heap<>(10);
heap.insert(5);
heap.insert(4);
heap.insert(6);
heap.insert(1);
Assert.assertEquals(heap.size(), 4);
Assert.assertEquals(6, (int) heap.delMax());
Assert.assertEquals(5, (int) heap.delMax());
Assert.assertEquals(4, (int) heap.delMax());
Assert.assertEquals(1, (int) heap.delMax());
Assert.assertTrue(heap.isEmpty());
}
}