@@ -22,8 +22,8 @@ public static void DoTest()
22
22
** 4 5
23
23
** \ / \
24
24
** 5 ===> 4 7
25
- ** \
26
- ** 7
25
+ ** \
26
+ ** 7
27
27
**
28
28
***************************************
29
29
*/
@@ -65,7 +65,7 @@ public static void DoTest()
65
65
// DOUBLE *right* rotation for node 5.
66
66
//
67
67
// The double rotation is achieved by:
68
- // 1> Simple *left* rotation for node 2, and then
68
+ // 1> Simple *left* rotation for node 2, and then
69
69
// 2> Simple *right* rotation for node 5
70
70
//
71
71
/*************************************
@@ -92,7 +92,7 @@ public static void DoTest()
92
92
// DOUBLE *right* rotation for node 5.
93
93
//
94
94
// The double rotation is achieved by:
95
- // 1> Simple *right* rotation for node 7, and then
95
+ // 1> Simple *right* rotation for node 7, and then
96
96
// 2> Simple *left* rotation for node 5
97
97
//
98
98
/**************************************************************************
@@ -119,7 +119,7 @@ public static void DoTest()
119
119
//
120
120
/**************************************************************************
121
121
** UNBALANCED ===> TRANSITION (1st R) ===> BALANCED (2nd Rt)
122
- ** null .6..
122
+ ** null .6..
123
123
** / \ / \
124
124
** 2 6 ===> ===> 2 7
125
125
** / \ / \ / \ /
@@ -132,7 +132,7 @@ public static void DoTest()
132
132
// ASSERT CASE 5
133
133
AssertCase_5 ( avlTree ) ;
134
134
135
-
135
+
136
136
//
137
137
// CLEAR THE TREE AND START OVER
138
138
// Compare two binary trees with each other (height-wise) using bulk-inserts
@@ -152,56 +152,48 @@ public static void DoTest()
152
152
153
153
//
154
154
// Draw the tree to the console.
155
- Console . WriteLine ( String . Format ( "************\r \n ** BST TREE:\r \n ************\r \n " ) ) ;
155
+ Console . WriteLine ( "************\r \n ** BST TREE:\r \n ************\r \n " ) ;
156
156
Console . WriteLine ( bsTree . DrawTree ( ) ) ;
157
157
158
158
Console . WriteLine ( "\r \n \r \n " ) ;
159
159
160
- Console . WriteLine ( String . Format ( "************\r \n ** AVL TREE:\r \n ************\r \n " ) ) ;
160
+ Console . WriteLine ( "************\r \n ** AVL TREE:\r \n ************\r \n " ) ;
161
161
Console . WriteLine ( avlTree . DrawTree ( ) ) ;
162
162
163
163
//
164
164
// OUTPUT OF AVL TREE DRAWER
165
- /*****
166
- ** ************
167
- ** ** AVL TREE:
168
- ** ************
169
- ** ....15...
170
- ** / \
171
- ** ...9.. ..20.
172
- ** / \ / \
173
- ** ..5. 11 16 28
174
- ** / \ / \ / \ / \
175
- ** 1 7 9 12 19 25 30
176
- ** /\ / \ / \ / \ /\ /\ / \
177
- ** -1 7 8 10 13 39
178
- ** /\ /\ /\ /\ /\ /\
179
- *
165
+ /**
166
+ ** .....15....
167
+ ** / \
168
+ ** ...9... .20
169
+ ** / \ / \
170
+ ** .5 11 16 28
171
+ ** / \ / \ \ / \
172
+ ** 1 7 9 12 19 25 30
173
+ ** / / \ \ \ \
174
+ ** -1 7 8 10 13 39
180
175
*/
181
176
182
177
183
178
treeDataList = new List < int > ( ) { 15 , 25 , 5 , 12 , 1 , 9 , 7 , - 1 , 11 , 30 , 8 , 10 , 13 , 28 , 39 } ;
184
179
avlTree . Clear ( ) ;
185
180
avlTree . Insert ( treeDataList ) ;
186
181
187
- Console . WriteLine ( String . Format ( "************\r \n ** AVL TREE:\r \n ************\r \n " ) ) ;
182
+ Console . WriteLine ( "************\r \n ** AVL TREE:\r \n ************\r \n " ) ;
188
183
Console . WriteLine ( avlTree . DrawTree ( ) ) ;
189
184
190
185
//
191
186
// OUTPUT OF AVL TREE DRAWER
192
- /*****
193
- **
194
- ** .......9......
195
- ** / \
196
- ** .5 ....12...
197
- ** / \ / \
198
- ** 1 7 11 .25.
199
- ** /\ / \ /\ / \
200
- ** -1 8 10 15 30
201
- ** /\ /\ /\ /\ / \
202
- ** 13 28 39
203
- ** /\ /\ /\
204
- **
187
+ /**
188
+ ** ....9...
189
+ ** / \
190
+ ** 5 .12.
191
+ ** / \ / \
192
+ ** 1 7 11 25
193
+ ** / \ / / \
194
+ ** -1 8 10 15 30
195
+ ** / / \
196
+ ** 13 28 39
205
197
*/
206
198
207
199
Console . ReadLine ( ) ;
0 commit comments