Best case and Worst case of Algorithms Flashcards

1
Q

Best and Worst for Linear Search?

A

Worst-case Runtime: θ(n)
Best-case Runtime: O(1)

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

Best and Worst for Binary Search?

A

Worst-case Runtime: O(log n)
Best-case Runtime: O(1)

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

Best and Worst for Insertion Sort?

A

Worst-case Runtime: O(n^2)
Best-case Runtime: O(n)

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

Best and Worst for Merge Sort?

A

Worst-case Runtime: O(nlogn)
Worst-case Runtime: O(nlogn)

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

Best and Worst for Heap Sort?

A

Worst-case Runtime: O(nlogn)
Worst-case Runtime: O(nlogn)

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

Best and Worst for Quicksort?

A

Worst-case Runtime: O(n^2)
Worst-case Runtime: O(nlogn)

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

Best and Worst for Counting Sort?

A

Worst-case Runtime: O(n)
Worst-case Runtime: O(n)

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

Best and Worst for Radixsort?

A

Worst-case Runtime: O(n)
Worst-case Runtime: O(n)

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