-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTests.java
33 lines (28 loc) · 921 Bytes
/
Tests.java
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
31
32
33
package Utils;
import BinomialHeap.BinomialHeap;
public class Tests extends TestHelper {
public static void main(String[] args) {
TestInsert();
}
/**
* @pre existence of an empty constructor in BinomialHeap
*/
public static void TestInsert() {
BinomialHeap heap = new BinomialHeap();
insertKeyArray(heap, new int[]{15, 35, 20, 31, 40, 43, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90});
// BinomialHeap.HeapNode root = heap.last;
// BinomialHeap.HeapNode child = assertPointers(heap, root, 40, 20, 35);
// child = assertPointers(heap, child, 45, 43);
PrintHeap.printHeap(heap, true);
// test for
// - size
// - rank
}
}
abstract class TestHelper {
static void insertKeyArray(BinomialHeap heap, int[] keys) {
for (int key : keys) {
heap.insert(key, String.valueOf(key));
}
}
}