data-structures-linked-lists Flashcards

1
Q

How are linked lists different from an array?

A

Linked lists are sequential access (like a queue) and arrays are random access. This means that, in order to go a specific place in the list, you have to start at the beginning, then jump from node to node until you get there.

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

Using the .next property and chaining them.

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