Skip to content

Conversation

@ubeninja77
Copy link

No description provided.

Copy link

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

Thanks for getting this in Lola. You hit the main learning goals here. Take a look at my comments, most revolve around time/space complexity. Let me know what questions you have.

Comment on lines +21 to 23
# Time Complexity: O(1)
# Space Complexity: O(1)
def add_first(value)

Choose a reason for hiding this comment

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

👍

Comment on lines +29 to 31
# Time Complexity: O(1)
# Space Complexity: O(1)
def search(value)

Choose a reason for hiding this comment

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

👍 , but why do you think the time complexity is O(1)? You're looping through the list.

Comment on lines 42 to 44
# method to return the max value in the linked list
# returns the data value and not the node
def find_max

Choose a reason for hiding this comment

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

👍

Comment on lines +59 to 61
# Time Complexity: O(n)
# Space Complexity: O(1)
def find_min

Choose a reason for hiding this comment

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

👍

Comment on lines +75 to 77
# Time Complexity: O(n)
# Space Complexity: O(1)
def length

Choose a reason for hiding this comment

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

👍

Comment on lines +93 to 95
# Time Complexity: O(n)
# Space Complexity: O(1)
def get_at_index(index)

Choose a reason for hiding this comment

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

But what if index >= length?

Comment on lines +106 to 108
# Time Complexity: O(n)
# Space Complexity: O(n)
def visit

Choose a reason for hiding this comment

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

👍 , but how is the space complexity O(n), what other data structure are you creating?

Comment on lines +120 to 122
# Time Complexity: O(n)
# Space Complexity: O(n)
def delete(value)

Choose a reason for hiding this comment

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

👍 , why do you think the space complexity is O(n), what new data structure are you creating?

Comment on lines +144 to 146
# Time Complexity: O(n)
# Space Complexity: O(1)
def reverse

Choose a reason for hiding this comment

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

👍

Comment on lines 192 to 194
# Time Complexity: ?
# Space Complexity: ?
def get_first

Choose a reason for hiding this comment

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

👍 , time/space complexity?

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