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)
2
Q
Best and Worst for Binary Search?
A
Worst-case Runtime: O(log n)
Best-case Runtime: O(1)
3
Q
Best and Worst for Insertion Sort?
A
Worst-case Runtime: O(n^2)
Best-case Runtime: O(n)
4
Q
Best and Worst for Merge Sort?
A
Worst-case Runtime: O(nlogn)
Worst-case Runtime: O(nlogn)
5
Q
Best and Worst for Heap Sort?
A
Worst-case Runtime: O(nlogn)
Worst-case Runtime: O(nlogn)
6
Q
Best and Worst for Quicksort?
A
Worst-case Runtime: O(n^2)
Worst-case Runtime: O(nlogn)
7
Q
Best and Worst for Counting Sort?
A
Worst-case Runtime: O(n)
Worst-case Runtime: O(n)
8
Q
Best and Worst for Radixsort?
A
Worst-case Runtime: O(n)
Worst-case Runtime: O(n)