-
Notifications
You must be signed in to change notification settings - Fork 68
Gloria #52
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
base: master
Are you sure you want to change the base?
Gloria #52
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.
Overall nice work, you hit the main learning goals here. Well done.
self.head = None #keep the head private.Not accessible outside class | ||
self.len = 0 | ||
self.tail = None | ||
self.max = 0 |
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.
You're not actually using the tail
etc
# Time Complexity: ? | ||
# Space Complexity: ? | ||
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/space complexity?
# Time Complexity: ? | ||
# Space Complexity: ? | ||
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/space complexity?
# next_node = self.head | ||
self.head = Node(value, next_node = self.head) | ||
self.len += 1 | ||
self.update_max(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.
Nice little helper
# Time Complexity: ? | ||
# Space Complexity: ? | ||
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/space complexity?
|
||
if counter == 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.
if counter == index: | |
if counter == index: | |
# Time Complexity: ? | ||
# Space Complexity: ? | ||
def get_last(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/space complexity?
if self.len == 0: | ||
self.tail = Node(value, next_node = None) | ||
self.head = self.tail | ||
self.update_max(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.
You only really use tail
here, but you would potentially need to update it in add_first
and remove_first
etc.
@@ -89,7 +163,24 @@ def visit(self): | |||
# Time Complexity: ? | |||
# Space Complexity: ? | |||
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.
Just noting this is empty.
# Time Complexity: ? | ||
# Space Complexity: ? | ||
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/space complexity?
Gloria,
You didn't actually make a PR instead you sent in a link to the screen before submitting the PR...