Skip to content

Commit

Permalink
Update inorder-successor-in-bst.py
Browse files Browse the repository at this point in the history
  • Loading branch information
kamyu104 committed Sep 22, 2015
1 parent 1fff0ea commit 896a430
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Python/inorder-successor-in-bst.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def inorderSuccessor(self, root, p):
:rtype: TreeNode
"""
# If it has right subtree.
if p.right:
if p and p.right:
p = p.right
while p.left:
p = p.left
Expand Down

0 comments on commit 896a430

Please sign in to comment.