-
Notifications
You must be signed in to change notification settings - Fork 48
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
Space - Charlotte - Linked List #34
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work Charlotte, you hit the requirements here. Well done.
# Time Complexity: 0(1) | ||
# Space Complexity: 0(1) | ||
|
||
def add_first(value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
# Time Complexity:0(n) with n being the length of the list | ||
# Space Complexity:0(n) | ||
def search(value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 , but the space complexity is O(1) as you're not creating a new list here.
# method to return the max value in the linked list | ||
# returns the data value and not the node | ||
def find_max |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
# Time Complexity: 0(n) with n being the length of the list | ||
# Space Complexity: 0(n) | ||
def find_min |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 , but the space complexity is O(1) as you're not creating a new list here.
# Time Complexity: 0(n) with n being the length | ||
# Space Complexity: 0(n) | ||
def length |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 , but the space complexity is O(1) as you're not creating a new list here.
# Time Complexity: 0(n) with n being the length of the list | ||
# Space Complexity: 0(n) | ||
def get_at_index(index) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 , but the space complexity is O(1) as you're not creating a new list here.
# Time Complexity: 0(n) with n being the length of the list | ||
# Space Complexity: 0(n) | ||
def visit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 , but the space complexity is O(1) as you're not creating a new list here.
# Time Complexity: 0(n) n being the length of the list | ||
# Space Complexity: 0(n) | ||
def reverse |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 , but the space complexity is O(1) as you're not creating a new list here.
No description provided.