Big O Notation Flashcards

1
Q

linear search best case time complexity

A

O(1)

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

linear search average case time complexity

A

O(n)

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

linear search worst case time complexity

A

O(n)

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

Binary search array best case time complexity

A

O(1)

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

Binary search array average case time complexity

A

O(log n)

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

Binary search array worst case time complexity

A

O(log n)

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

Binary search tree best case time complexity

A

O(1)

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

Binary search tree average case time complexity

A

O(log n)

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

Binary search tree worst case time complexity

A

O(n)

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

Hashing best case time complexity

A

O(1)

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

Hashing average case time complexity

A

O(1)

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

Hashing worst case time complexity

A

O(n)

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

Breadth/depth-first of graph best case time complexity

A

O(1)

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

Breadth/depth-first of graph average case time complexity

A

O(V+E)

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

Breadth/depth-first of graph worst case time complexity

A

O(V^2)

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

Bubble sort best case time complexity

17
Q

Bubble sort average case time complexity

18
Q

Bubble sort worst case time complexity

19
Q

Bubble sort space complexity

20
Q

Insertion sort best case time complexity

21
Q

Insertion sort average case time complexity

22
Q

Insertion sort worst case time complexity

23
Q

Insertion sort space complexity

24
Q

Merge sort best case time complexity

A

O(n log n)

25
Q

Merge sort average case time complexity

A

O(n log n)

26
Q

Merge sort worst case time complexity

A

O(n log n)

27
Q

Merge sort space complexity

28
Q

Quick sort best case time complexity

A

O(n log n)

29
Q

Quick sort average case time complexity

A

O(n log n)

30
Q

Quick sort worst case time complexity

31
Q

Quick sort space complexity

32
Q

Meaning of O(1)

A

Constant
same time regardless of size of data set

33
Q

Meaning of O(log n)

A

Logarithmic
halves the data set in each pass
opposite of exponential
directly proportional to logarithmic result of input size

34
Q

Meaning of O(n)

A

Linear
time increases proportional to size of data set

35
Q

Meaning of O(n log n)

A

Linearithmic

36
Q

Meaning of O(n^2)

A

Polynomial
time increases proportional to square of size of data set
nested loops

37
Q

Meaning of O(2^n)

A

Exponential
doubles with each addition to data set in each pass
opposite to logarithmic