Skip to content

Conversation

kmalakhova
Copy link

No description provided.

@kmalakhova kmalakhova changed the title Pass the tests Paper - Malakhova K. Jan 16, 2022
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.

Nice work Kate, you hit the learning goals here. I only left minor feedback.


# Time Complexity:
# Space Complexity:
def add_helper(self, current_node, key, value):

Choose a reason for hiding this comment

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

👍 Space/time complexity?


# Time Complexity: O(logN)
# Space Complexity: O(logN)
def add(self, key, value = None):

Choose a reason for hiding this comment

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

👍

Comment on lines +41 to 43
# Time Complexity: O(logN)
# Space Complexity: O(logN)
def find(self, key):

Choose a reason for hiding this comment

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

👍 Nice recursive solution

Comment on lines +55 to 57
# Time Complexity: O(N)
# Space Complexity: O(N)
def inorder(self):

Choose a reason for hiding this comment

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

👍

Comment on lines +68 to 70
# Time Complexity: O(N)
# Space Complexity: O(N)
def preorder(self):

Choose a reason for hiding this comment

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

👍

Comment on lines +81 to 83
# Time Complexity: O(N)
# Space Complexity: O(N)
def postorder(self):

Choose a reason for hiding this comment

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

👍

Comment on lines +93 to 95
# Time Complexity: O(logN)
# Space Complexity: O(logN)
def height(self):

Choose a reason for hiding this comment

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

👍 However the time complexity is O(n) because you visit each node.

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