From a5e923a387f8380ede28b0b7a4bf0983e02b6705 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BE=9A=E5=9B=BD=E7=8E=AE?= Date: Thu, 29 Dec 2022 14:44:15 +0800 Subject: [PATCH 1/2] test(binary_search_tree): update test param use param value 7, not 5, function test param value with param value in example picture as same. --- codes/go/chapter_tree/binary_search_tree_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codes/go/chapter_tree/binary_search_tree_test.go b/codes/go/chapter_tree/binary_search_tree_test.go index 0d0369a78..d98e5d661 100644 --- a/codes/go/chapter_tree/binary_search_tree_test.go +++ b/codes/go/chapter_tree/binary_search_tree_test.go @@ -23,7 +23,7 @@ func TestBinarySearchTree(t *testing.T) { fmt.Println("二叉树的最小结点为:", node.Val) // 查找结点 - node = bst.Search(5) + node = bst.Search(7) fmt.Println("查找到的结点对象为", node, ",结点值 =", node.Val) // 插入结点 From 96d54bff3a983373ffc2d9c18d8b8446472d780e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BE=9A=E5=9B=BD=E7=8E=AE?= Date: Tue, 10 Jan 2023 12:16:02 +0800 Subject: [PATCH 2/2] test(binary_search_tree): update test param all the language use param value 7, not 5. function test param value with param value in example picture as same. --- codes/cpp/chapter_tree/binary_search_tree.cpp | 2 +- codes/csharp/chapter_tree/binary_search_tree.cs | 2 +- codes/java/chapter_tree/binary_search_tree.java | 2 +- codes/javascript/chapter_tree/binary_search_tree.js | 2 +- codes/python/chapter_tree/binary_search_tree.py | 2 +- codes/typescript/chapter_tree/binary_search_tree.ts | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) 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); /* 插入结点 */