Subversion Repositories programming

Rev

Rev 49 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 49 Rev 50
Line 23... Line 23...
23
 
23
 
24
        testEquals();
24
        testEquals();
25
        System.out.println();
25
        System.out.println();
26
 
26
 
27
        testRemove();
27
        testRemove();
-
 
28
        System.out.println();
-
 
29
 
-
 
30
        testHeight();
-
 
31
        System.out.println();
-
 
32
 
-
 
33
        testPrint();
-
 
34
        System.out.println();
28
    }
35
    }
29
    
36
    
30
    //creates an array of Integers from an array of ints. The returned array
37
    //creates an array of Integers from an array of ints. The returned array
31
    //will have all of the values multiplied by 200 (just to give my data
38
    //will have all of the values multiplied by 200 (just to give my data
32
    //different values from the keys
39
    //different values from the keys
Line 150... Line 157...
150
        }
157
        }
151
        
158
        
152
        //print the tree after everything has been removed
159
        //print the tree after everything has been removed
153
        System.out.println("tree = " + tree);
160
        System.out.println("tree = " + tree);
154
    }
161
    }
-
 
162
    
-
 
163
    //method to test some heights
-
 
164
    public static void testHeight() {
-
 
165
        AVLTree tree = createTestTree(30);
-
 
166
 
-
 
167
        for( int i=0; i<30; i++ ) { 
-
 
168
            System.out.println("Node with key: " + i + " has height: " 
-
 
169
                               + tree.getHeight(i)); 
-
 
170
        }
-
 
171
    }
-
 
172
 
-
 
173
    public static void testPrint() {
-
 
174
        AVLTree tree = createTestTree(30);
-
 
175
        
-
 
176
        System.out.println("Printing InOrder:");
-
 
177
        AVLTree.printInOrder(tree);
-
 
178
 
-
 
179
        System.out.println();
-
 
180
        System.out.println("Printing PreOrder:");
-
 
181
        AVLTree.printPreOrder(tree);
-
 
182
    }
-
 
183
        
155
}
184
}
156
 
185