binary search tree insert() function modify。

insert the greater value to right,smaller value to left。
This commit is contained in:
liushubin lwx470335
2020-06-23 09:06:00 +08:00
parent 433f129080
commit fce7e22d8f

View File

@@ -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);
}