@@ -118,11 +118,11 @@ public static void DoTest()
118118 //
119119 /**************************************************************************
120120 ** UNBALANCED ===> TRANSITION (1st R) ===> BALANCED (2nd Rt)
121- ** null .6 ..
121+ ** null .5 ..
122122 ** / \ / \
123- ** 2 6 ===> ===> 2 7
124- ** / \ / \ / \ /
125- ** 1 3 5 7 1 3 5
123+ ** 2 6 ===> ===> 2 6
124+ ** / \ / \ / \ \
125+ ** 1 3 5 7 1 3 7
126126 **
127127 **************************************************************************
128128 */
@@ -251,18 +251,18 @@ private static void AssertCase_5(AVLTree<int> avlTree)
251251 {
252252 var avlRoot = avlTree . Root ;
253253 Assert . True ( avlRoot . Height == 2 , "Wrong root height!" ) ;
254- Assert . True ( avlRoot . Value == 6 , "Wrong root." ) ;
254+ Assert . True ( avlRoot . Value == 5 , "Wrong root." ) ;
255255 Assert . True ( avlRoot . LeftChild . Value == 2 , "Wrong left child from root." ) ;
256- Assert . True ( avlRoot . RightChild . Value == 7 , "Wrong right child from root." ) ;
256+ Assert . True ( avlRoot . RightChild . Value == 6 , "Wrong right child from root." ) ;
257257 Assert . True ( avlRoot . LeftChild . LeftChild . Value == 1 , "Wrong value at {root->left->left}." ) ;
258258 Assert . True ( avlRoot . LeftChild . RightChild . Value == 3 , "Wrong value at {root->left->right}." ) ;
259- Assert . True ( avlRoot . RightChild . LeftChild . Value == 5 , "Wrong value at {root->right->left}." ) ;
260- Assert . True ( avlRoot . RightChild . RightChild == null , "Wrong value at {root->right->right}." ) ;
259+ Assert . True ( avlRoot . RightChild . LeftChild == null , "Wrong value at {root->right->left}." ) ;
260+ Assert . True ( avlRoot . RightChild . RightChild . Value == 7 , "Wrong value at {root->right->right}." ) ;
261261
262262 Assert . True (
263263 avlRoot . LeftChild . LeftChild . Height == 0
264264 && avlRoot . LeftChild . RightChild . Height == 0
265- && avlRoot . RightChild . LeftChild . Height == 0
265+ && avlRoot . RightChild . RightChild . Height == 0
266266 ,
267267 "Wrong heights at the leaf nodes!." ) ;
268268
0 commit comments