Skip to content

Ruiz#59

Open
Jruiz9312 wants to merge 1 commit intoAda-C16:masterfrom
Jruiz9312:master
Open

Ruiz#59
Jruiz9312 wants to merge 1 commit intoAda-C16:masterfrom
Jruiz9312:master

Conversation

@Jruiz9312
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.

✨ Awesome work, Juliana. Let me know what questions you have.

🟢


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

✨ Nice recursive solution

return self.find_helper(current.right, key)
# Time Complexity: O(log n)
# Space Complexity: O(log n)
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 +34 to +35
self.add_helper(self.root, key, value)
def find_helper(self, current, key):

Choose a reason for hiding this comment

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

🤓 Style note: We like to add a blank line between the end of one function and the beginning of another


# Time Complexity: O(n)
# Space Complexity: O(n)
def inorder(self):

Choose a reason for hiding this comment

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


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

Choose a reason for hiding this comment

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


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

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)
# Space Complexity: O(log n)
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 -49 to -50
# # 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 bfs(self):

Choose a reason for hiding this comment

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

✨😎 Really nice work!

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