-
Notifications
You must be signed in to change notification settings - Fork 69
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
base: master
Are you sure you want to change the base?
Conversation
Grabbing this to grade! |
There was a problem hiding this 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 |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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))
There was a problem hiding this comment.
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.
No description provided.