mirror of
https://github.com/autistic-symposium/master-algorithms-py.git
synced 2025-04-29 20:26:07 -04:00
Update bst.py
This commit is contained in:
parent
a2dce9493e
commit
51e6497cef
@ -25,11 +25,11 @@ class Node(object):
|
||||
def search(self, item):
|
||||
if self.value == item:
|
||||
return True
|
||||
found = False
|
||||
|
||||
if (self.left and self.left.search(item)) or \
|
||||
(self.right and self.right.search(item)):
|
||||
found = True
|
||||
return found
|
||||
return True
|
||||
return False
|
||||
|
||||
def preorder(self):
|
||||
yield self.value
|
||||
|
Loading…
x
Reference in New Issue
Block a user