-
Notifications
You must be signed in to change notification settings - Fork 43
Branches - Eve #42
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
base: master
Are you sure you want to change the base?
Branches - Eve #42
Conversation
CheezItMan
left a comment
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.
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.
| # Time Complexity: O(logn) in best case | ||
| # Space Complexity: O(1) | ||
| def find(key) |
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.
👍
| # Time Complexity: O(logn) in best case | ||
| # Space Complexity: O(1) | ||
| def add(key, value) |
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.
👍
| # Time Complexity: O(n) with n is the number of nodes in the tree | ||
| # Space Complexity: O(n) | ||
| def inorder |
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.
Nicely done with a loop!
| return list | ||
| end | ||
|
|
||
| def preorder |
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.
👍
| return list | ||
| end | ||
|
|
||
| def postorder |
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.
👍
| # 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) |
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.
👍 Nicely done!
| # Time Complexity: O(n) | ||
| # Space Complexity: O(n) | ||
| def bfs |
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.
👍
No description provided.