‘’’
def find(self, data):
node = self.root
a = self.ins(node,data)
return a
def ins(self,node,data):
if node == None:
return
if node.data == data:
return True
if data < node.data:
if node.left == None:
return False
else:
self.ins(node.left,data)
if data > node.data:
if node.right == None:
return False
else:
self.ins(node.right,data)
‘’’
I cannnot figure out what is wrong with this code in searching for a node in BST. Tried everything and made sure there is no mistake in calling self or functional fault but still having nightmares solving it
Type your question above this line.
Course: https://www.educative.io/collection/10370001/5474278013140992
Lesson: https://www.educative.io/collection/page/10370001/5474278013140992/5348074945773568