Menu
×
×
Correct!
Exercise:How is a value searched for in a Binary Search Tree?
def search(node, target):
if node is None:
return None
elif node.data == target:
return node
elif target < node.data:
return search(node.@(4), target)
else:
return search(node.@(5), target)
def search(node, target):
if node is None:
return None
elif node.data == target:
return node
elif target < node.data:
return search(node.left, target)
else:
return search(node.right, target)
Not CorrectClick here to try again. Correct!Next ❯ |
This will reset the score of ALL 43 exercises.
Are you sure you want to continue?