Question: Consider a generalization of Median-of-Five algorithm which has a parameter for an integer 1. Instead of partitioning input into n/5 blocks of size 5, the
Consider a generalization of Median-of-Five algorithm which has a parameter for an integer 1. Instead of partitioning input into n/5 blocks of size 5, the algorithm partitions the input into n/(2 + 1) blocks of size 2 + 1 (assume n is a power of 2 + 1). Note that the algorithm becomes the median-of-five algorithm when = 2.
a) derive a recursive formula for the time complexity T(n) of this algorithm as a function of n and (there is no need to solve the recursion; just deduce the recursive definition of T(n)).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
