AuD
Lecture 'Algorithmen und Datenstrukturen' (code examples)
BTreeTest.java
Go to the documentation of this file.
1package aud.test;
2
3import aud.BTree;
5
6import org.junit.*;
7import static org.junit.Assert.*;
8
9public class BTreeTest {
10
11 @Test
12 public void testBTree() {
13 String[] keys={"a","b","c","d","e","f","g","h","i"};
14 int n=keys.length;
15
16 for (int m=1;m<3;++m) {
17 for (int[] p : new Permutations(n)) {
18
19 BTree<String> tree=new BTree<String>(m);
20
21 for (int i : p) {
22 String k=tree.find(keys[i]);
23 assertEquals(k,null);
24 tree.insert(keys[i]);
25 k=tree.find(keys[i]);
26 assertTrue(k!=null);
27 assertTrue(k.compareTo(keys[i])==0);
28 tree.checkConsistency();
29 }
30 }
31 }
32 }
33
34 public static void main(String args[]) {
35 org.junit.runner.JUnitCore.main("aud.test.BTreeTest");
36 }
37}
static void main(String args[])
Definition: BTreeTest.java:34
Generate permutations.
utilities (not related to AuD lecture)
Definition: Colormap.java:1
AuD lecture: Data structures, algorithms, examples.
Definition: A234Tree.java:1