Skip to content

Commit 1ee8199

Browse files
committed
test: Add successful tests in binaree_tree_path_sum
1 parent 7c4ddc6 commit 1ee8199

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

data_structures/binary_tree/binary_tree_path_sum.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,19 @@ class BinaryTreePathSum:
5656
0
5757
5858
The second tree looks like this
59-
60-
>>> tree2 = Node(0)
61-
>>> tree2.left = Node(5)
62-
>>> tree2.right = Node(5)
6359
0
6460
/ \
6561
5 5
66-
>>> BinaryTreePathSum().path_sum(tree, 5)
62+
63+
>>> tree2 = Node(0)
64+
>>> tree2.left = Node(5)
65+
>>> tree2.right = Node(15)
66+
67+
>>> BinaryTreePathSum().path_sum(tree2, 5)
6768
2
68-
>>> BinaryTreePathSum().path_sum(tree, -1)
69+
>>> BinaryTreePathSum().path_sum(tree2, -1)
6970
0
70-
>>> BinaryTreePathSum().path_sum(tree, 0)
71+
>>> BinaryTreePathSum().path_sum(tree2, 0)
7172
1
7273
7374
"""

0 commit comments

Comments
 (0)