mirror of
				https://github.com/krahets/hello-algo.git
				synced 2025-11-04 22:28:40 +08:00 
			
		
		
		
	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.
This commit is contained in:
		@ -131,7 +131,7 @@ int main() {
 | 
				
			|||||||
    PrintUtil::printTree(bst->getRoot());
 | 
					    PrintUtil::printTree(bst->getRoot());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /* 查找结点 */
 | 
					    /* 查找结点 */
 | 
				
			||||||
    TreeNode* node = bst->search(5);
 | 
					    TreeNode* node = bst->search(7);
 | 
				
			||||||
    cout << endl << "查找到的结点对象为 " << node << ",结点值 = " << node->val << endl;
 | 
					    cout << endl << "查找到的结点对象为 " << node << ",结点值 = " << node->val << endl;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /* 插入结点 */
 | 
					    /* 插入结点 */
 | 
				
			||||||
 | 
				
			|||||||
@ -163,7 +163,7 @@ namespace hello_algo.chapter_tree
 | 
				
			|||||||
            PrintUtil.PrintTree(bst.getRoot());
 | 
					            PrintUtil.PrintTree(bst.getRoot());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            /* 查找结点 */
 | 
					            /* 查找结点 */
 | 
				
			||||||
            TreeNode? node = bst.search(5);
 | 
					            TreeNode? node = bst.search(7);
 | 
				
			||||||
            Console.WriteLine("\n查找到的结点对象为 " + node + ",结点值 = " + node.val);
 | 
					            Console.WriteLine("\n查找到的结点对象为 " + node + ",结点值 = " + node.val);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            /* 插入结点 */
 | 
					            /* 插入结点 */
 | 
				
			||||||
 | 
				
			|||||||
@ -131,7 +131,7 @@ public class binary_search_tree {
 | 
				
			|||||||
        PrintUtil.printTree(bst.getRoot());
 | 
					        PrintUtil.printTree(bst.getRoot());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /* 查找结点 */
 | 
					        /* 查找结点 */
 | 
				
			||||||
        TreeNode node = bst.search(5);
 | 
					        TreeNode node = bst.search(7);
 | 
				
			||||||
        System.out.println("\n查找到的结点对象为 " + node + ",结点值 = " + node.val);
 | 
					        System.out.println("\n查找到的结点对象为 " + node + ",结点值 = " + node.val);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /* 插入结点 */
 | 
					        /* 插入结点 */
 | 
				
			||||||
 | 
				
			|||||||
@ -126,7 +126,7 @@ console.log("\n初始化的二叉树为\n");
 | 
				
			|||||||
printTree(getRoot());
 | 
					printTree(getRoot());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* 查找结点 */
 | 
					/* 查找结点 */
 | 
				
			||||||
let node = search(5);
 | 
					let node = search(7);
 | 
				
			||||||
console.log("\n查找到的结点对象为 " + node + ",结点值 = " + node.val);
 | 
					console.log("\n查找到的结点对象为 " + node + ",结点值 = " + node.val);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* 插入结点 */
 | 
					/* 插入结点 */
 | 
				
			||||||
 | 
				
			|||||||
@ -145,7 +145,7 @@ if __name__ == "__main__":
 | 
				
			|||||||
    print_tree(bst.root)
 | 
					    print_tree(bst.root)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # 查找结点
 | 
					    # 查找结点
 | 
				
			||||||
    node = bst.search(5)
 | 
					    node = bst.search(7)
 | 
				
			||||||
    print("\n查找到的结点对象为: {},结点值 = {}".format(node, node.val))
 | 
					    print("\n查找到的结点对象为: {},结点值 = {}".format(node, node.val))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # 插入结点
 | 
					    # 插入结点
 | 
				
			||||||
 | 
				
			|||||||
@ -150,7 +150,7 @@ console.log('\n初始化的二叉树为\n');
 | 
				
			|||||||
printTree(getRoot());
 | 
					printTree(getRoot());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* 查找结点 */
 | 
					/* 查找结点 */
 | 
				
			||||||
let node = search(5);
 | 
					let node = search(7);
 | 
				
			||||||
console.log('\n查找到的结点对象为 ' + node + ',结点值 = ' + node!.val);
 | 
					console.log('\n查找到的结点对象为 ' + node + ',结点值 = ' + node!.val);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* 插入结点 */
 | 
					/* 插入结点 */
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user