-
Notifications
You must be signed in to change notification settings - Fork 68
C16 - Spruce - Vange #51
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?
Conversation
# Time Complexity: | ||
# Space Complexity: |
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.
What do you think the space and time complexity of this is? Is the time complexity dependent on the size of the binary search tree? Is there any new variables being created that grow larger depending upon the input?
else: | ||
current_node.right = self.add_helper(current_node.right, key, value) | ||
return current_node | ||
|
||
# Time Complexity: | ||
# Space Complexity: | ||
def add(self, key, value = None): |
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: | ||
# Space Complexity: |
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.
What do you think the space and time complexity of this is? Is the time complexity dependent on the size of the binary search tree? Is there any new variables being created that grow larger depending upon the input?
if self.root == None: | ||
self.root = TreeNode(key, value) | ||
else: | ||
self.add_helper(self.root, key, value) | ||
|
||
# Time Complexity: | ||
# Space Complexity: | ||
def find(self, 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.
👍
return inorder_list | ||
|
||
# # Time Complexity: | ||
# # Space Complexity: | ||
def inorder(self): |
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: | ||
# # Space Complexity: |
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.
What do you think the space and time complexity of this is? Is the time complexity dependent on the size of the binary search tree? Is there any new variables being created that grow larger depending upon the input?
# Time Complexity: | ||
# Space Complexity: |
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.
What do you think the space and time complexity of this is? Is the time complexity dependent on the size of the binary search tree? Is there any new variables being created that grow larger depending upon the input?
# Time Complexity: | ||
# Space Complexity: |
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.
What do you think the space and time complexity of this is? Is the time complexity dependent on the size of the binary search tree? Is there any new variables being created that grow larger depending upon the input?
# Time Complexity: | ||
# Space Complexity: |
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.
What do you think the space and time complexity of this is? Is the time complexity dependent on the size of the binary search tree? Is there any new variables being created that grow larger depending upon the input?
if lefth > righth: | ||
return lefth + 1 | ||
else: | ||
return righth + 1 | ||
|
||
# Time Complexity: | ||
# Space Complexity: | ||
def height(self): |
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.
👍
better l8 than n3ver :)