diff --git a/codes/cpp/chapter_tree/binary_search_tree.cpp b/codes/cpp/chapter_tree/binary_search_tree.cpp index 246bdbaa1..648e194ae 100644 --- a/codes/cpp/chapter_tree/binary_search_tree.cpp +++ b/codes/cpp/chapter_tree/binary_search_tree.cpp @@ -131,7 +131,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 8224317df..3cb991486 100644 --- a/codes/csharp/chapter_tree/binary_search_tree.cs +++ b/codes/csharp/chapter_tree/binary_search_tree.cs @@ -163,7 +163,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/java/chapter_tree/binary_search_tree.java b/codes/java/chapter_tree/binary_search_tree.java index 0770c567d..1755df56b 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 1e0d92738..345cff555 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 23e341854..811b3829d 100644 --- a/codes/python/chapter_tree/binary_search_tree.py +++ b/codes/python/chapter_tree/binary_search_tree.py @@ -145,7 +145,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 6dad83421..1222b8d5d 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); /* 插入结点 */