Skip to content

Conversation

@aliceboone
Copy link

Linked List Comprehension Questions

Question Response
1. What advantages does a LinkedList have over an Array? Linked list are dynamically allocated, each node can be located anywhere in memory, ease of insertion/deletion.
2. When is an Array more advantageous? With arrays you can jump to any element in the list with O(1) time because the elements are contiguous.
3. What questions do you have about linked lists? N/A

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.

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

Comment on lines +10 to 12
# Time complexity - O(1)
# Space complexity - O(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.

👍

Comment on lines +18 to 20
# Time complexity - O(1)
# Space complexity - O(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 +24 to 26
# Time complexity - 0(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 +38 to 40
# Time complexity -0(n)
# Space complexity - O(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.

👍

Comment on lines +54 to 56
# Time complexity -0(n)
# Space complexity - O(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 +66 to 68
# 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.

👍

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