Fix the test case of the binary tree dfs in Java.

This commit is contained in:
Yudong Jin 2023-01-08 19:08:07 +08:00
parent 4839c23432
commit 3ba37dba3a

View File

@ -43,7 +43,7 @@ public class binary_tree_dfs {
public static void main(String[] args) {
/* 初始化二叉树 */
// 这里借助了一个从数组直接生成二叉树的函数
TreeNode root = TreeNode.arrToTree(new Integer[] { 1, null, 3, 4, 5 });
TreeNode root = TreeNode.arrToTree(new Integer[] { 1, 2, 3, 4, 5, 6, 7 });
System.out.println("\n初始化二叉树\n");
PrintUtil.printTree(root);