示例#1
0
def root_1a() -> solution.TreeNode:
    root = solution.TreeNode(val=1)

    root.left = solution.TreeNode(val=3)
    root.left.left = solution.TreeNode(val=5)

    root.right = solution.TreeNode(val=2)

    return root
示例#2
0
def root_1b() -> solution.TreeNode:
    root = solution.TreeNode(val=2)

    root.left = solution.TreeNode(val=1)
    root.left.right = solution.TreeNode(val=4)\

    root.right = solution.TreeNode(val=3)
    root.right.right = solution.TreeNode(val=7)

    return root
示例#3
0
def expected_1() -> solution.TreeNode:
    root = solution.TreeNode(val=3)

    root.left = solution.TreeNode(val=4)
    root.left.left = solution.TreeNode(val=5)
    root.left.right = solution.TreeNode(val=4)

    root.right = solution.TreeNode(val=5)
    root.right.right = solution.TreeNode(val=7)

    return root
示例#4
0
def expected_2() -> solution.TreeNode:
    root = solution.TreeNode(val=2)
    root.left = solution.TreeNode(val=2)
    return root
示例#5
0
def root_2b() -> solution.TreeNode:
    root = solution.TreeNode(val=1)
    root.left = solution.TreeNode(val=2)
    return root
示例#6
0
def root_2a() -> solution.TreeNode:
    root = solution.TreeNode(val=1)
    return root