Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Heather #13

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Heather #13

wants to merge 3 commits into from

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.

# Time Complexity:
# 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