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

Spruce C16- Emily Colon #38

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

emilycolonq
Copy link

No description provided.

@chimerror
Copy link

Grabbing this to grade!

Copy link

@chimerror chimerror left a comment

Choose a reason for hiding this comment

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

Good work!

I added a comment about an unneeded import statement, and added a caveat to your complexity calculations for your height implementation, but this is overall good enough for a Green!

@@ -1,3 +1,6 @@
from xml.dom import Node

Choose a reason for hiding this comment

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

It looks like this import statement never got used, so you can delete it.

# Time Complexity:
# Space Complexity:
# Time Complexity: O(n)
# Space Complexity: O(n)

Choose a reason for hiding this comment

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

These are both correct assuming the tree is unbalanced, but if balanced it'd move down to O(log(n))

Choose a reason for hiding this comment

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

Sorry, I have decided this is a nonsensical assumption to move down to O(log(n)) for time complexity as we still have to travel to every node even in a balanced tree. Likewise, as there is no additional space being used, I think the space complexity should be O(1).

Forgive me for the confusion, but I was going off our instructor solution and I realized there is a mistake in their calculations too.

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