Skip to content

Conversation

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

Nice implementation, Lety! You are missing the time and space complexity for all but one of your functions, so I am marking this as a yellow. Let me know what questions you have.

🟡

class Tree:
def __init__(self):
self.root = None

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

⏱🪐 Time and space complexity?


# Time Complexity: O(log n)
# Space Complexity: O(1)

def find(self, key):

Choose a reason for hiding this comment

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

✨ Nice iterative solution


# Time Complexity:
# Space Complexity:

def inorder_helper_norecursion(self, current_node, trav_list):

Choose a reason for hiding this comment

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

🌟😎 Really cool you did it with both

Comment on lines 64 to 65
# 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 103 to 104
# 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 127 to +128
# Time Complexity:
# 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?

trav_list = self.preorder_helper(current_node.right, trav_list)

return trav_list

def preorder(self):

Choose a reason for hiding this comment

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


return trav_list


def postorder(self):

Choose a reason for hiding this comment

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

Comment on lines 152 to 153
# 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?


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