Skip to content

Ruiz#73

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

Ruiz#73
Jruiz9312 wants to merge 2 commits intoAda-C16:masterfrom
Jruiz9312:master

Conversation

@Jruiz9312
Copy link

No description provided.

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, Juliana. I gave you some pointers on delete since it seems like you ran into a bit of trouble there, and left some comments on Big O, but overall you have a great implementation. Let me know what questions you have.

🟢

Comment on lines 19 to 20
# Time Complexity: ?
# Space Complexity: ?

Choose a reason for hiding this comment

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

⏱🪐 Time and space complexity?

# 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.


# 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.

# current = self.head
elif current.value == value:
self.head = current.next
return True

Choose a reason for hiding this comment

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

You don't need to return a value here

Suggested change
return True
return

Comment on lines +136 to +137
# current = self.head
elif current.value == value:

Choose a reason for hiding this comment

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

Right now you are referencing current before it exists

Suggested change
# current = self.head
elif current.value == value:
current = self.head
if current.value == value:

# Time Complexity: ?
# Space Complexity: ?
# Time Complexity: o(n)
# Space Complexity: o(1)

Choose a reason for hiding this comment

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

🪐 Space complexity will be O(n) here since you are creating the list helper_list which will end up holding all of the nodes in the linked list

# 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.

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, Juliana. I gave you some pointers on delete since it seems like you ran into a bit of trouble there, and left some comments on Big O, but overall you have a great implementation. Let me know what questions you have.

🟢

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