Big O Notations - Data Structures Flashcards

1
Q

Array

A
Average Case:
    Access: Θ(1)	
    Search: Θ(n)
    Insertion: Θ(n)
    Deletion: Θ(n)
Worst Case
    Access: Θ(1)	
    Search: Θ(n)
    Insertion: Θ(n)
    Deletion: Θ(n)

Space (worst case): Θ(n)

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

Stack

A
Average Case:
    Access: Θ(n)
    Search: Θ(n)
    Insertion: Θ(1)	
    Deletion: Θ(1)
Worst Case
    Access: Θ(n)
    Search: Θ(n)
    Insertion: Θ(1)
    Deletion: Θ(1)

Space (worst case): Θ(n)

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

Queue

A
Average Case:
    Access: Θ(n)
    Search: Θ(n)
    Insertion: Θ(1)
    Deletion: Θ(1)
Worst Case
    Access: Θ(n)
    Search: Θ(n)
    Insertion: Θ(1)
    Deletion: Θ(1)

Space (worst case): Θ(n)

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

Singly-Linked List

A
Average Case:
    Access: Θ(n)
    Search: Θ(n)
    Insertion: Θ(1)
    Deletion: Θ(1)
Worst Case
    Access: Θ(n)
    Search: Θ(n)
    Insertion: Θ(1)
    Deletion: Θ(1)

Space (worst case): Θ(n)

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

Doubly-Linked List

A
Average Case:
    Access: Θ(n)
    Search: Θ(n)
    Insertion: Θ(1)
    Deletion: Θ(1)
Worst Case
    Access: Θ(n)
    Search: Θ(n)
    Insertion: Θ(1)
    Deletion: Θ(1)

Space (worst case): Θ(n)

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

Skip List

A
Average Case:
    Access:  Θ(log(n))
    Search: Θ(log(n))
    Insertion: Θ(log(n))
    Deletion: Θ(log(n))
Worst Case
    Access: Θ(n)
    Search: Θ(n)
    Insertion: Θ(n)
    Deletion: Θ(n)

Space (worst case): Θ(log(n))

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

Hash Table (Dictionary)

A
Average Case:
    Access: N/A
    Search: Θ(1)
    Insertion: Θ(1)
    Deletion: Θ(1)
Worst Case
    Access: N/A
    Search: Θ(n)
    Insertion: Θ(n)
    Deletion: Θ(n)

Space (worst case): Θ(n)

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

Binary Search Tree

A
Average Case:
    Access:  Θ(log(n))
    Search: Θ(log(n))
    Insertion: Θ(log(n))
    Deletion: Θ(log(n))
Worst Case
    Access: Θ(n)
    Search: Θ(n)
    Insertion: Θ(n)
    Deletion: Θ(n)

Space (worst case): Θ(n)

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

Cartesian Tree

A
Average Case:
    Access:  N/A
    Search: Θ(log(n))
    Insertion: Θ(log(n))
    Deletion: Θ(log(n))
Worst Case
    Access:  N/A
    Search: Θ(n)
    Insertion: Θ(n)
    Deletion: Θ(n)

Space (worst case): Θ(n)

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

B-Tree

A
Average Case:
    Access:  Θ(log(n))
    Search: Θ(log(n))
    Insertion: Θ(log(n))
    Deletion: Θ(log(n))
Worst Case:
    Access:  Θ(log(n))
    Search: Θ(log(n))
    Insertion: Θ(log(n))
    Deletion: Θ(log(n))

Space (worst case): Θ(n)

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

Red-Black Tree

A
Average Case:
    Access:  Θ(log(n))
    Search: Θ(log(n))
    Insertion: Θ(log(n))
    Deletion: Θ(log(n))
Worst Case:
    Access:  Θ(log(n))
    Search: Θ(log(n))
    Insertion: Θ(log(n))
    Deletion: Θ(log(n))

Space (worst case): Θ(n)

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

Splay Tree

A
Average Case:
    Access:  N/A
    Search: Θ(log(n))
    Insertion: Θ(log(n))
    Deletion: Θ(log(n))
Worst Case:
    Access:  N/A
    Search: Θ(log(n))
    Insertion: Θ(log(n))
    Deletion: Θ(log(n))

Space (worst case): Θ(n)

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

AVL Tree

A
Average Case:
    Access:  Θ(log(n))
    Search: Θ(log(n))
    Insertion: Θ(log(n))
    Deletion: Θ(log(n))
Worst Case:
    Access:  Θ(log(n))
    Search: Θ(log(n))
    Insertion: Θ(log(n))
    Deletion: Θ(log(n))

Space (worst case): Θ(n)

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

KD Tree

A
Average Case:
    Access:  Θ(log(n))
    Search: Θ(log(n))
    Insertion: Θ(log(n))
    Deletion: Θ(log(n))
Worst Case
    Access: Θ(n)
    Search: Θ(n)
    Insertion: Θ(n)
    Deletion: Θ(n)

Space (worst case): Θ(n)

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