File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -226,9 +226,9 @@ void inOrder(struct node *root){
226
226
int i ;
227
227
if (root == NULL ) return ;
228
228
else {
229
- for (i = 0 ; i < root -> keyCount ; i ++ ){ // -1 since left and right key of every data box
229
+ for (i = 0 ; i < root -> keyCount - 1 ; i ++ ){ // -1 since left and right key of every data box
230
230
inOrder (root -> keys [i ]);
231
- if (( void * ) root -> value [ i ] != NULL ) printf ("~%d~\n" ,root -> value [i ]);
231
+ printf ("~%d~\n" ,root -> value [i ]);
232
232
}
233
233
}
234
234
}
@@ -237,8 +237,8 @@ void levelOrder(struct node *root){
237
237
int i ;
238
238
if (root == NULL ) return ;
239
239
else {
240
- for (i = 0 ; i < root -> keyCount ; i ++ ){ // -1 since left and right key of every data box
241
- if (( void * ) root -> value [ i ] != NULL || root -> value [ i ] != ( int ) NULL ) printf ("%d " ,root -> value [i ]);
240
+ for (i = 0 ; i < root -> keyCount - 1 ; i ++ ){ // -1 since left and right key of every data box
241
+ printf ("%d " ,root -> value [i ]);
242
242
}
243
243
printf (" " );
244
244
if (root -> parent == NULL ) printf ("\n" );
You can’t perform that action at this time.
0 commit comments