Skip to content

Mary Tian CS Fun Linked Lists#80

Open
Mary-Tian wants to merge 2 commits intoAda-C16:masterfrom
Mary-Tian:master
Open

Mary Tian CS Fun Linked Lists#80
Mary-Tian wants to merge 2 commits intoAda-C16:masterfrom
Mary-Tian:master

Conversation

@Mary-Tian
Copy link

No description provided.

@Mary-Tian Mary-Tian closed this Jul 27, 2022
@Mary-Tian Mary-Tian reopened this Jul 27, 2022
Copy link

@kyra-patton kyra-patton left a comment

Choose a reason for hiding this comment

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

✨💫 Nice work, Mary. I left a couple of comments and suggestions, but overall it looks like you have a good understanding of linked lists. Let me know what questions you have.

🟢

# Space Complexity: ?
# Time Complexity: O(1)
# Space Complexity: O(1)
def get_first(self):

Choose a reason for hiding this comment

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

# Space Complexity: ?
# Time Complexity: O(1)
# Space Complexity: O(1)
def add_first(self, value):

Choose a reason for hiding this comment

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

# Space Complexity: ?
# Time Complexity: O(n)
# Space Complexity: O(1)
def search(self, value):

Choose a reason for hiding this comment

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

# Space Complexity: ?
# Time Complexity: O(n)
# Space Complexity: O(1)
def length(self):

Choose a reason for hiding this comment

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

# Space Complexity: ?
# Time Complexity: O(n)
# Space Complexity: O(1)
def get_at_index(self, index):

Choose a reason for hiding this comment

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

Comment on lines +107 to +108
if current.next == None:
break

Choose a reason for hiding this comment

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

🤓 We generally like to avoid break statements where possible. How might you refactor your code to eliminate this break statement?


# method to return the max value in the linked list
# returns the data value and not the node
def find_max(self):

Choose a reason for hiding this comment

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

# Space Complexity: ?
# Time Complexity: O(n)
# Space Complexity: O(1)
def delete(self, value):

Choose a reason for hiding this comment

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

# Space Complexity: ?
# Time Complexity: O(n)
# Space Complexity: O(n)
def visit(self):

Choose a reason for hiding this comment

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

# Space Complexity: ?
# Time Complexity: O(n)
# Space Complexity: O(1)
def reverse(self):

Choose a reason for hiding this comment

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

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