Question: In (n) time, using the classic deterministic Selection algorithm with groups of size 5. (a) Show what happens if we form groups of size 3
In (n) time, using the classic deterministic Selection algorithm with groups of size 5.
(a) Show what happens if we form groups of size 3 instead.
(b) Show what happens if we use groups of size c, where c represents an odd integer greater than 5. Even though c = O(1), try not to remove it from the final calculation.
(c) See what happens if we use n groups of size n, as well as 5 groups of size n/5 . For these cases, you should consider adapting the algorithm slightly when trying to optimize.
In all cases, either prove that we still get O(n) time or prove that we cannot get O(n) time. You may assume that division always produces an integer value.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
