-
Notifications
You must be signed in to change notification settings - Fork 391
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
Spruce-C16 | Zandra | LinkedList #10
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.
One note, please make PRs against the Ada-C16 remote repo.
Nice work Zandra, you hit the required methods. Well done. I left a few minor comments, but this is a nice submission.
# Time Complexity: (O)1? | ||
# Space Complexity: O(1)? | ||
|
||
def get_first(self): |
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: (O)1? | ||
# Space Complexity: O(1)? | ||
|
||
def add_first(self, 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: O(n)? | ||
# Space Complexity: O(1)? | ||
|
||
def search(self, 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: O(n)? | ||
# Space Complexity: O(1)? | ||
|
||
def length(self): |
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: O(n)? | ||
# Space Complexity: O(1)? | ||
|
||
def get_at_index(self, 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.
👍
# Time Complexity: O(n)? | ||
# Space Complexity: O(n)? | ||
|
||
def add_last(self, 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.
👍 However the space complexity here is O(1)
|
||
# method to return the max value in the linked list | ||
# returns the data value and not the node | ||
|
||
def find_max(self): |
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: O(n)? | ||
# Space Complexity: O(1)? | ||
def delete(self, 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: O(n)? | ||
# Space Complexity: O(n)? | ||
|
||
def visit(self): |
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: O(n) ? | ||
# Space Complexity: O(1)? | ||
|
||
def reverse(self): |
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.
👍 However think about better variable names than p1
and p2
No description provided.