Skip to content

Commit 9b40bf8

Browse files
author
Raven G. Duran
committed
Still on 3+ Levels
1 parent 20af300 commit 9b40bf8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

btree.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,12 +200,12 @@ struct node* insertN(int value,struct node *root,struct node *parent){
200200
for (i = 0; i <= left; i++){ // Move all left half data to new LeftHalf Box
201201
leftHalf = insertN(root->value[i],leftHalf,parent); // Set the parent to NULL temporarily
202202
leftHalf->keys[i] = root->keys[i];
203-
}
203+
} leftHalf->keys[left+1] = root->keys[left+1];
204204

205205
for (i = right; i < treeOrder; i++){ // Move all right half data to new LeftHalf Box
206206
rightHalf = insertN(root->value[i],rightHalf,parent);
207207
rightHalf->keys[i] = root->keys[i];
208-
}
208+
} rightHalf->keys[treeOrder] = root->keys[treeOrder];
209209

210210
int pIsNull = parent == NULL ? 1 : 0;
211211
struct node *tempRoot = root;

btree.exe

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)