mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-02-09 05:27:11 +08:00
binary search tree insert() function modify。
insert the greater value to right,smaller value to left。
This commit is contained in:
@@ -43,7 +43,7 @@ void Insert(node *n, int x) {
|
||||
temp->val = x;
|
||||
temp->left = NULL;
|
||||
temp->right = NULL;
|
||||
n->left = temp;
|
||||
n->right = temp;
|
||||
} else {
|
||||
Insert(n->right, x);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user