Skip to content

Binary Search Tree Paper Karla T. #55

Open
ktiktok96 wants to merge 1 commit intoAda-C15:masterfrom
ktiktok96:master
Open

Binary Search Tree Paper Karla T. #55
ktiktok96 wants to merge 1 commit intoAda-C15:masterfrom
ktiktok96:master

Conversation

@ktiktok96
Copy link
Copy Markdown

Binary Search Tree w/ time/space complexity

Copy link
Copy Markdown

@CheezItMan CheezItMan left a comment

Choose a reason for hiding this comment

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

Nice work Karla, you hit the learning goals here. Well done.

Comment on lines +17 to +20
# Time Complexity: O(log n)
# Space Complexity: O(log n )

def add_helper(self, current, key, value):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍 Time/space complexity is correct if the tree is balanced. O(n) otherwise.

Comment on lines +36 to 38
# Time Complexity: O( log n )
# Space Complexity: O (log 1 )
def find(self, key):
Copy link
Copy Markdown

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 +63
# Time Complexity: O(n)
# Space Complexity: O(n)
def preorder_helper(self, current_node, listofvalues):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍

Comment on lines +76 to +78
# Time Complexity: O(n)
# Space Complexity: O(n)
def postorder_helper(self, current_node, listofvalues):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍

Comment on lines +89 to +91
# Time Complexity: O(n)
# Space Complexity: O(log n)
def height_helper(self, current_node):
Copy link
Copy Markdown

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