Exemplo n.º 1
0
def test_same_tree_5():
    p = TreeNode(1)
    p.right = TreeNode(2)
    q = TreeNode(1)
    q.right = TreeNode(2)
    expected = True
    actual = is_same_tree(p, q)
    assert actual == expected
Exemplo n.º 2
0
def test_same_tree_2():
    p = TreeNode(1)
    p.left = TreeNode(2)
    q = TreeNode(1)
    q.right = TreeNode(2)
    expected = False
    actual = is_same_tree(p, q)
    assert actual == expected
Exemplo n.º 3
0
def test_same_tree_4():
    p = TreeNode(1)
    q = TreeNode(1)
    expected = True
    actual = is_same_tree(p, q)
    assert actual == expected