From fce7e22d8f142c1ad9b73317c64c489ae0eba802 Mon Sep 17 00:00:00 2001 From: liushubin lwx470335 Date: Tue, 23 Jun 2020 09:06:00 +0800 Subject: [PATCH] =?UTF-8?q?binary=20search=20tree=20insert=EF=BC=88?= =?UTF-8?q?=EF=BC=89=20function=20modify=E3=80=82=20insert=20the=20greater?= =?UTF-8?q?=20value=20to=20right=EF=BC=8Csmaller=20value=20to=20left?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data_structures/binary_search_tree.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data_structures/binary_search_tree.cpp b/data_structures/binary_search_tree.cpp index 947bb53d8..3cc7d09fb 100644 --- a/data_structures/binary_search_tree.cpp +++ b/data_structures/binary_search_tree.cpp @@ -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); }