Linked Lists Flashcards

1
Q

Add to front runtime

A

O(1) if we keep track of the head (node)

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

Add to end runtime

A

O(1) if we keep track of the tail (node)

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

Remove from front runtime

A

Can be O(1)

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

Searching runtime

A

O(N), linear

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

Insert runtime

A

O(N), linear

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

Remove runtime

A

O(N), linear

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

The basis of a linked list

A

Uses an array.
O(1) time to look at any index in the array.
Grows dynamically; can grow and shrink list dynamically

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