Skip to content

Space - Jeta #31

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 1 commit into
base: master
Choose a base branch
from
Open

Space - Jeta #31

wants to merge 1 commit into from

Conversation

jetabajrami
Copy link

No description provided.

Copy link

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

Overall well done, you hit the learning goals here. Nice work.

Comment on lines +19 to 21
# Time Complexity: O(log n)
# Space Complexity: 0(1)
def add(key, value)

Choose a reason for hiding this comment

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

👍 , the time complexity is O(log n) if the tree is balanced.

Comment on lines +46 to 48
# Time Complexity: O(log n)
# Space Complexity: 0(1)
def find(key)

Choose a reason for hiding this comment

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

👍 , the time complexity is O(log n) if the tree is balanced.

Comment on lines +67 to 69
# Time Complexity: 0(n)
# Space Complexity: 0(n)
def inorder

Choose a reason for hiding this comment

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

👍

Comment on lines +88 to 90
# Time Complexity: 0(n)
# Space Complexity: 0(n)
def preorder

Choose a reason for hiding this comment

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

👍

Comment on lines +110 to 112
# Time Complexity: 0(n)
# Space Complexity: 0(n)
def postorder

Choose a reason for hiding this comment

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

👍

Comment on lines +132 to 134
# Time Complexity: 0(n)
# Space Complexity: 0(n)
def height

Choose a reason for hiding this comment

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

👍 , the space complexity is O(n) if the tree is unbalanced. O(log n) if it is balanced.

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