Skip to content

Conversation

@Schmarj3
Copy link

Linked List Comprehension Questions

Question Response
1. What advantages does a LinkedList have over an Array? can be created with fragmented memory allocation
2. When is an Array more advantageous? easier to look an item up by index
3. What questions do you have about linked lists? What is an example of it being used in an actual situation?

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.

Well done Marj, you hit the learning goals here. Nice work.

Comment on lines +10 to 12
# Time complexity - 1
# Space complexity - 1
def add_first(data)

Choose a reason for hiding this comment

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

👍 I assume you mean O(1)

Comment on lines +24 to 26
# Time complexity - 1
# Space complexity - 1
def get_first

Choose a reason for hiding this comment

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

👍

Comment on lines +30 to 32
# Time complexity - n
# Space complexity - 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 +43 to 45
# Time complexity - 1
# Space complexity - 1
def add_last(data)

Choose a reason for hiding this comment

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

👍 How could this be O(1) time complexity???? ⚠️

Comment on lines +62 to 64
# Time complexity - n
# Space complexity - 1
def get_last

Choose a reason for hiding this comment

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

👍

Comment on lines +76 to 78
# Time complexity - n
# Space complexity - 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.

👍

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