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

Faiza A. #17

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

Faiza A. #17

wants to merge 7 commits into from

Conversation

Faiza1987
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.

You got almost everything done. However you didn't list the Big-O of each method and you didn't get height done. Otherwise nice work!

Take a look at my comments and let me know what questions you have.

@@ -18,45 +18,101 @@ def initialize

# Time Complexity:

Choose a reason for hiding this comment

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

Time and space complexity?

end

# Time Complexity:
# Space Complexity:
def height
raise NotImplementedError
def height(current = @root, array)

Choose a reason for hiding this comment

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

The height of a tree at any node will be the max height of the left subtree compared to the right subtree plus one.

Does that help?

Remember if a current is nil the height is 0.

end

# Optional Method
# Time Complexity:
# Space Complexity:
def bfs
raise NotImplementedError
def bfs(current = @root, array = [])

Choose a reason for hiding this comment

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

For this you'll need a Queue, which we'll talk about in class a bit.

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