Skip to content

Conversation

@piffer59
Copy link

@piffer59 piffer59 commented Sep 3, 2019

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.

Nice work, you got the major parts here. I like how you used the TreeNode class to do the operations and the Tree class just wrapped it. Well done!

def height(tree_height)
# left_height = 0
# right_heigt = 0
# if !left.nil?

Choose a reason for hiding this comment

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

I would say

unless left.nil?
  left_height = left.height + 1
end

You can do the same with right, and then return the larger of left and right's heights plus 1.

# Space Complexity:
# Time Complexity:
# Space Complexity:
def bfs

Choose a reason for hiding this comment

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

You'll have a tool to help with this on Thursday. Look for it.

:p

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