Skip to content
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

BTS 16/18 #62

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

BTS 16/18 #62

wants to merge 1 commit into from

Conversation

N-Washington
Copy link

No description provided.

Copy link

@kyra-patton kyra-patton 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 implementation, Nicole. Because the time and space complexity is missing, I am marking this as a yellow. Let me know what questions you have.

🟡

# Time Complexity:
# Space Complexity:

Choose a reason for hiding this comment

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

⏱🪐 Time and space complexity?

Comment on lines -22 to -23
# Time Complexity:
# Space Complexity:

Choose a reason for hiding this comment

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

⏱🪐 Time and space complexity?


# 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.

Comment on lines -28 to +65
# Space Complexity:
# Space Complexity:

Choose a reason for hiding this comment

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

⏱🪐 Time and space complexity?


# Time Complexity:
# Space 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.

# append key value pairs as backtrack up the stack
inorder_result.append({'key': current_node.key, 'value': current_node.value})
# traverse right
self.inorder_helper(current_node.right, inorder_result)

# Time Complexity:
# Space Complexity:
def preorder(self):

Choose a reason for hiding this comment

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

Comment on lines 108 to 109
# Time Complexity:
# Space Complexity:

Choose a reason for hiding this comment

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

⏱🪐 Time and space complexity?

preorder_result.append({'key': curr_node.key, 'value': curr_node.value})
self.preorder_helper(curr_node.left, preorder_result)
self.preorder_helper(curr_node.right, preorder_result)


# Time Complexity:
# Space Complexity:
def postorder(self):

Choose a reason for hiding this comment

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

if curr_node is None:
return 0
return 1 + max(self.height_helper(curr_node.left), self.height_helper(curr_node.right))


# 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.

Comment on lines 129 to 130
# Time Complexity:
# Space Complexity:

Choose a reason for hiding this comment

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

⏱🪐 Time and space complexity?

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