-
Notifications
You must be signed in to change notification settings - Fork 44
Space - Lee #15
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?
Space - Lee #15
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.
Excellent work Lee, you hit all the requirements. Very well done.
| # Time Complexity: O(log n) for balanced trees, O(n) for unbalanced trees; where n is the number of nodes | ||
| # Space Complexity: O(n), where n is the height | ||
| 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(log n) for balanced trees, O(n) for unbalanced trees; where n is the number of nodes | ||
| # Space Complexity: O(n), where n is the height | ||
| def find(key, current = @root) |
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), where n is the number of nodes | ||
| # Space Complexity: O(n), where n is the height | ||
| 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.
👍
| # Time Complexity: O(n), where n is the number of nodes | ||
| # Space Complexity: O(n), where n is the height | ||
| 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.
👍
| # Time Complexity: O(n), where n is the number of nodes | ||
| # Space Complexity: O(n), where n is the height | ||
| 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), where n is the number of nodes | ||
| # Space Complexity: O(n), where n is the height | ||
| def height(current = @root, height = 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.
👍
No description provided.