Conversation
|
Grabbing this to grade! |
chimerror
left a comment
There was a problem hiding this comment.
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.
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.
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.
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.