Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion search/binary_search_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ def __init__(self, value):
self.right = None

def depth_first_for_each(self, cb):
pass
cb(self.value)
if self.left != None:
self.left.depth_first_for_each(cb)
if self.right != None:
self.right.depth_first_for_each(cb)
return
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✔️



def breadth_first_for_each(self, cb):
pass
Expand Down