Skip to content

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

HouseOfVange
Copy link

better l8 than n3ver :)

Comment on lines 26 to 27
# Time Complexity:
# Space Complexity:

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):

Choose a reason for hiding this comment

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

👍

Comment on lines 34 to 35
# Time Complexity:
# Space Complexity:

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):

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):

Choose a reason for hiding this comment

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

👍

Comment on lines +61 to +62
# # Time Complexity:
# # Space Complexity:

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?

Comment on lines 77 to 78
# Time Complexity:
# Space Complexity:

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?

Comment on lines 93 to 94
# Time Complexity:
# Space Complexity:

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?

Comment on lines 114 to 115
# Time Complexity:
# Space Complexity:

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):

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