diff --git a/codes/cpp/chapter_tree/binary_search_tree.cpp b/codes/cpp/chapter_tree/binary_search_tree.cpp index 78e797746..006d7d308 100644 --- a/codes/cpp/chapter_tree/binary_search_tree.cpp +++ b/codes/cpp/chapter_tree/binary_search_tree.cpp @@ -133,7 +133,7 @@ int main() { PrintUtil::printTree(bst->getRoot()); /* 查找结点 */ - TreeNode* node = bst->search(5); + TreeNode* node = bst->search(7); cout << endl << "查找到的结点对象为 " << node << ",结点值 = " << node->val << endl; /* 插入结点 */ diff --git a/codes/csharp/chapter_tree/binary_search_tree.cs b/codes/csharp/chapter_tree/binary_search_tree.cs index d2e5f95e6..e12cdd425 100644 --- a/codes/csharp/chapter_tree/binary_search_tree.cs +++ b/codes/csharp/chapter_tree/binary_search_tree.cs @@ -159,7 +159,7 @@ namespace hello_algo.chapter_tree PrintUtil.PrintTree(bst.getRoot()); /* 查找结点 */ - TreeNode? node = bst.search(5); + TreeNode? node = bst.search(7); Console.WriteLine("\n查找到的结点对象为 " + node + ",结点值 = " + node.val); /* 插入结点 */ diff --git a/codes/go/chapter_tree/binary_search_tree_test.go b/codes/go/chapter_tree/binary_search_tree_test.go index 877f1b541..2109d5a44 100644 --- a/codes/go/chapter_tree/binary_search_tree_test.go +++ b/codes/go/chapter_tree/binary_search_tree_test.go @@ -20,8 +20,8 @@ func TestBinarySearchTree(t *testing.T) { fmt.Println("\n二叉树的根结点为:", node.Val) // 查找结点 - node = bst.search(5) - fmt.Println("\n查找到的结点对象为", node, ",结点值 =", node.Val) + node = bst.Search(7) + fmt.Println("查找到的结点对象为", node, ",结点值 =", node.Val) // 插入结点 node = bst.insert(16) diff --git a/codes/java/chapter_tree/binary_search_tree.java b/codes/java/chapter_tree/binary_search_tree.java index 4a7f3194e..a3b0f7584 100644 --- a/codes/java/chapter_tree/binary_search_tree.java +++ b/codes/java/chapter_tree/binary_search_tree.java @@ -131,7 +131,7 @@ public class binary_search_tree { PrintUtil.printTree(bst.getRoot()); /* 查找结点 */ - TreeNode node = bst.search(5); + TreeNode node = bst.search(7); System.out.println("\n查找到的结点对象为 " + node + ",结点值 = " + node.val); /* 插入结点 */ diff --git a/codes/javascript/chapter_tree/binary_search_tree.js b/codes/javascript/chapter_tree/binary_search_tree.js index c00d8bea8..9c808aaae 100644 --- a/codes/javascript/chapter_tree/binary_search_tree.js +++ b/codes/javascript/chapter_tree/binary_search_tree.js @@ -126,7 +126,7 @@ console.log("\n初始化的二叉树为\n"); printTree(getRoot()); /* 查找结点 */ -let node = search(5); +let node = search(7); console.log("\n查找到的结点对象为 " + node + ",结点值 = " + node.val); /* 插入结点 */ diff --git a/codes/python/chapter_tree/binary_search_tree.py b/codes/python/chapter_tree/binary_search_tree.py index 2a8272761..8817d4a5a 100644 --- a/codes/python/chapter_tree/binary_search_tree.py +++ b/codes/python/chapter_tree/binary_search_tree.py @@ -142,7 +142,7 @@ if __name__ == "__main__": print_tree(bst.root) # 查找结点 - node = bst.search(5) + node = bst.search(7) print("\n查找到的结点对象为: {},结点值 = {}".format(node, node.val)) # 插入结点 diff --git a/codes/typescript/chapter_tree/binary_search_tree.ts b/codes/typescript/chapter_tree/binary_search_tree.ts index a99e6ba26..9adf8cd15 100644 --- a/codes/typescript/chapter_tree/binary_search_tree.ts +++ b/codes/typescript/chapter_tree/binary_search_tree.ts @@ -150,7 +150,7 @@ console.log('\n初始化的二叉树为\n'); printTree(getRoot()); /* 查找结点 */ -let node = search(5); +let node = search(7); console.log('\n查找到的结点对象为 ' + node + ',结点值 = ' + node!.val); /* 插入结点 */