Skip to content

Conversation

@tofuandeve
Copy link

No description provided.

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.

Really nice work, you hit all the learning goals here. Very elegantly written code. Well done! Take a look at my comments on delete and let me know if you have questions.

Comment on lines +48 to 50
# Time Complexity: O(logn) in best case
# Space Complexity: O(1)
def find(key)

Choose a reason for hiding this comment

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

👍

Comment on lines +19 to 21
# Time Complexity: O(logn) in best case
# Space Complexity: O(1)
def add(key, value)

Choose a reason for hiding this comment

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

👍

Comment on lines +59 to 61
# Time Complexity: O(n) with n is the number of nodes in the tree
# Space Complexity: O(n)
def inorder

Choose a reason for hiding this comment

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

Nicely done with a loop!

return list
end

def preorder

Choose a reason for hiding this comment

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

👍

return list
end

def postorder

Choose a reason for hiding this comment

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

👍

Comment on lines +130 to +132
# Time Complexity: O(n) with n is the number of nodes in the tree
# Space Complexity: O(logn) which is also the height of the tree.
def height_helper(current_node, level = 0)

Choose a reason for hiding this comment

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

👍 Nicely done!

Comment on lines +143 to 145
# Time Complexity: O(n)
# Space Complexity: O(n)
def bfs

Choose a reason for hiding this comment

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

👍

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