Linked List vs List Big O Flashcards
1
Q
Append - Linked List
A
O(1) - same
2
Q
Append - List
A
0(1) - same
3
Q
Pop - Linked List
A
O(n) - worst
4
Q
Pop - List
A
O(1) - better
5
Q
Prepend - Linked List
A
O(1) - better
6
Q
Prepend - List
A
O(n) = worst
7
Q
Pop First - Linked List
A
O(1) - better
8
Q
Pop First - List
A
O(n) - worst
9
Q
Insert - Linked List
A
O(n) - same
10
Q
Insert - List
A
O(n) - same
11
Q
Remove - Linked List
A
O(n) - same
12
Q
Remove - List
A
O(n) - same
13
Q
Lookup by Index - Linked List
A
O(n) - worst
14
Q
Lookup by Index - List
A
O(1) - better
15
Q
Lookup by Value - Linked List
A
O(n) - same