Skip to content

Conversation

paperbackwriter2
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 some commented code and your space complexity calculation for height, but this is good enough for a Green!

# Space Complexity:
# def add(self, key, value = None):
# # base case
# if not current.left and not current.right:

Choose a reason for hiding this comment

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

Not a big deal, but generally I recommend removing unfinished but uncommented code like this to just keep the source clean as a style thing.



# Time Complexity: O(n) and n = # of nodes in BST
# Space Complexity: O(n) ? not sure on this one

Choose a reason for hiding this comment

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

Good news, neither are the instructors, because as I was doing this grading I realized our instructor solution was wrong on these calculations! In this case as there is no additional space allocated, I would consider this O(1).

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