Skip to content

Commit

Permalink
Merge pull request #47 from ayush1997/binarysearchtree.py#issue
Browse files Browse the repository at this point in the history
issue#46 Fixed bug in binarysearchtree.py
  • Loading branch information
prakhar1989 authored Oct 25, 2016
2 parents 21945f6 + fb232f7 commit 276a89d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions trees/binarysearchtree.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,13 @@ def insert(self, value):
else:
node = self.root
while node and node.value != value:
if node.value == value:
return
parent = node
if node.value < value:
node = node.right
else:
node = node.left
if node.value == value:
return
if parent.value > value:
parent.left = new_node
else:
Expand Down

0 comments on commit 276a89d

Please sign in to comment.