Skip to content

Commit c5e598a

Browse files
authored
Update merge-two-binary-trees.py
Added self for recursive calls
1 parent 6616b9d commit c5e598a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Python/merge-two-binary-trees.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,6 @@ def mergeTrees(self, t1, t2):
4848
if t2 is None:
4949
return t1
5050
t1.val += t2.val
51-
t1.left = mergeTrees(t1.left, t2.left)
52-
t1.right = mergeTrees(t1.right, t2.right)
51+
t1.left = self.mergeTrees(t1.left, t2.left)
52+
t1.right = self.mergeTrees(t1.right, t2.right)
5353
return t1

0 commit comments

Comments
 (0)