Data Structures Time and Space Complexity Flashcards

1
Q

What is the average to worst time complexity for array access, search, insertion, and deletion? What is the worst space complexity?

A
Access = O(1) - O(1)
Search = O(n) - O(n)
Insertion = O(n) - O(n)
Deletion = O(n) - O(n)
Space = O(n)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the average to worst time complexity for stack access, search, insertion, and deletion? What is the worst space complexity?

A
Access = O(n) - O(n)
Search = O(n) - O(n)
Insertion = O(1) - O(1)
Deletion = O(1) - O(1)
Space = O(n)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the average to worst time complexity for queue access, insertion, search, and deletion? What is the worst space complexity?

A
Access = O(n) - O(n)
Search = O(n) - O(n)
Insertion = O(1) - O(1)
Deletion = O(1) - O(1)
Space = O(n)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the average to worst time complexity for single-linked list access, insertion, search, and deletion? What is the worst space complexity?

A
Access = O(n) - O(n)
Search = O(n) - O(n)
Insertion = O(1) - O(1)
Deletion = O(1) - O(1)
Space = O(n)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the average to worst time complexity for double-linked list access, insertion, search, and deletion? What is the worst space complexity?

A
Access = O(n) - O(n)
Search = O(n) - O(n)
Insertion = O(1) - O(1)
Deletion = O(1) - O(1)
Space = O(n)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the average to worst time complexity for skip list access, insertion, search, and deletion? What is the worst space complexity?

A
Access = O(log n) - O(n)
Search = O(log n) - O(n)
Insertion = O(log n) - O(n)
Deletion = O(log n) - O(n)
Space = O(n log n)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the average to worst time complexity for binary search tree access, insertion, search, and deletion? What is the worst space complexity?

A
Access = O(log n) - O(n)
Seach = O(log n) - O(n)
Insertion = O(log n) - O(n)
Deletion = O(log n) - O(n)
Space = O(n)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the average to worst time complexity for Cartesian tree access, insertion, search, and deletion? What is the worst space complexity?

A
Access = N/A
Seach = O(log n) - O(n)
Insertion = O(log n) - O(n)
Deletion = O(log n) - O(n)
Space = O(n)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the average to worst time complexity for B-tree access, insertion, search, and deletion? What is the worst space complexity?

A
Access = O(log n) - O(log n)
Seach = O(log n) - O(log n)
Insertion = O(log n) - O(log n)
Deletion = O(log n) - O(log n)
Space = O(n)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the average to worst time complexity for red-black tree access, insertion, search, and deletion? What is the worst space complexity?

A
Access = O(log n) - O(log n)
Seach = O(log n) - O(log n)
Insertion = O(log n) - O(log n)
Deletion = O(log n) - O(log n)
Space = O(n)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the average to worst time complexity for splay tree access, insertion, search, and deletion? What is the worst space complexity?

A
Access = N/A
Seach = O(log n) - O(log n)
Insertion = O(log n) - O(log n)
Deletion = O(log n) - O(log n)
Space = O(n)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the average to worst time complexity for AVL tree access, insertion, search, and deletion? What is the worst space complexity?

A
Access = O(log n) - O(log n)
Seach = O(log n) - O(log n)
Insertion = O(log n) - O(log n)
Deletion = O(log n) - O(log n)
Space = O(n)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the average to worst time complexity for KD tree access, insertion, search, and deletion? What is the worst space complexity?

A
Access = O(log n) - O(log n)
Seach = O(log n) - O(log n)
Insertion = O(log n) - O(log n)
Deletion = O(log n) - O(log n)
Space = O(n)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the average to worst time complexity for hash table access, insertion, search, and deletion? What is the worst space complexity?

A
Access = N/A
Seach = O(1) - O(n)
Insertion = O(1) - O(n)
Deletion = O(1) - O(n)
Space = O(n)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly