Skip to content

Alison McGinley C15#42

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

Alison McGinley C15#42
elisonmcginley wants to merge 1 commit intoAda-C15:masterfrom
elisonmcginley:master

Conversation

@elisonmcginley
Copy link
Copy Markdown

No description provided.

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.

Great work Alison, you hit the learning goals here. This was almost perfect. Well done.

Comment on lines +16 to 18
# Time Complexity: O(1)
# Space Complexity: O(1)
def get_first(self):
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 +24 to 26
# Time Complexity: O(1)
# Space Complexity: O(1)
def add_first(self, 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.

👍

Comment on lines +27 to +30
if not self.head:
self.head = Node(value, self.head)
else:
self.head = Node(value, self.head)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Could be compacted

Suggested change
if not self.head:
self.head = Node(value, self.head)
else:
self.head = Node(value, self.head)
self.head = Node(value, self.head)

Comment on lines +34 to 36
# Time Complexity: O(n)
# Space Complexity: O(1)
def search(self, 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.

👍

Comment on lines +47 to 49
# Time Complexity: O(n)
# Space Complexity: O(1)
def length(self):
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 +126 to 128
# Time Complexity: O(n)
# Space Complexity: O(1)
def delete(self, 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.

👍

Comment on lines +146 to 148
# Time Complexity: O(n)
# Space Complexity: O(n)
def visit(self):
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 +160 to 162
# Time Complexity: O(n)
# Space Complexity: O(1)
def reverse(self):
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 +181 to 183
# Time Complexity: O(n)
# Space Complexity: O(1)
def find_middle_value(self):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍 Good use of prior methods

Comment on lines +190 to 192
# Time Complexity: O(n)
# Space Complexity: O(1)
def find_nth_from_end(self, n):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍 Nice use of prior methods and arithmetic!

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