data-structures-linked-lists Flashcards

1
Q

How are linked lists different from an array?

A

Linked lists are sequential access (like a queue), not random access (like an array). However, unlike a queue, a linked list doesn’t need to be mutated to scan its contents.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How would you access an arbitrary node in a linked list (not just the “head”)?

A

You to apply the next property to the head node repeatedly until you get to the arbitrary point

How well did you know this?
1
Not at all
2
3
4
5
Perfectly