@@ -118,11 +118,11 @@ public static void DoTest()
118
118
//
119
119
/**************************************************************************
120
120
** UNBALANCED ===> TRANSITION (1st R) ===> BALANCED (2nd Rt)
121
- ** null .6 ..
121
+ ** null .5 ..
122
122
** / \ / \
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
126
126
**
127
127
**************************************************************************
128
128
*/
@@ -251,18 +251,18 @@ private static void AssertCase_5(AVLTree<int> avlTree)
251
251
{
252
252
var avlRoot = avlTree . Root ;
253
253
Assert . True ( avlRoot . Height == 2 , "Wrong root height!" ) ;
254
- Assert . True ( avlRoot . Value == 6 , "Wrong root." ) ;
254
+ Assert . True ( avlRoot . Value == 5 , "Wrong root." ) ;
255
255
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." ) ;
257
257
Assert . True ( avlRoot . LeftChild . LeftChild . Value == 1 , "Wrong value at {root->left->left}." ) ;
258
258
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}." ) ;
261
261
262
262
Assert . True (
263
263
avlRoot . LeftChild . LeftChild . Height == 0
264
264
&& avlRoot . LeftChild . RightChild . Height == 0
265
- && avlRoot . RightChild . LeftChild . Height == 0
265
+ && avlRoot . RightChild . RightChild . Height == 0
266
266
,
267
267
"Wrong heights at the leaf nodes!." ) ;
268
268
0 commit comments