Skip to content

Conversation

@evelynnkaplan
Copy link

No description provided.

Copy link

@CheezItMan CheezItMan left a comment

Choose a reason for hiding this comment

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

Nicely done. I like how you created methods in TreeNode to do a lot of the things recursively. Nice work doing Breadth-first-search and using your Queue data structure. Great work!

size = 0
return 0 if self.empty?

@store.each do |i|

Choose a reason for hiding this comment

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

This could be a bit more efficient, if you went from front to end

# Space Complexity: O(n) where n is the number of nodes in the tree
def bfs
raise NotImplementedError
if @root == nil

Choose a reason for hiding this comment

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

Good use of the Queue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants