7import static org.junit.Assert.*;
13 String[] keys={
"a",
"b",
"c",
"d",
"e",
"f",
"g",
"h",
"i"};
17 {
int k=n;
while (k>0) { k>>=1; ++maxHeight; } }
18 maxHeight=2*maxHeight+2;
22 AVLTree<String,String> tree=
new AVLTree<String,String>();
25 String k=tree.find(keys[i]);
27 tree.insert(keys[i],keys[i]);
30 assertTrue(k.compareTo(keys[i])==0);
31 tree.checkConsistency();
33 assertTrue(tree.getHeight()<=maxHeight);
37 public static void main(String args[]) {
38 org.junit.runner.JUnitCore.main(
"aud.test.AVLTreeTest");
static void main(String args[])
utilities (not related to AuD lecture)
AuD lecture: Data structures, algorithms, examples.