Question: 1.Propose an algorithm to identify the minimum and maximum elements from a set of n distinct elements such that the number of comparisons by the
1.Propose an algorithm to identify the minimum and maximum elements from a set of n distinct elements such that the number of comparisons by the algorithm is no more than 3bn/2c.
2.Given a sequence of n elements, assume that n is odd, propose an algorithm to find the median of the sequence under the comparison model such that the number of comparisons is no more than d3n/2e.
3.There is an algorithm for the selection problem whose running time complexity can be expressed by the following recurrence. T(n) (1) if n 300 T(dn/11e) + T(8n/11 + 12) + O(n) if n > 300 Show that the algorithm takes linear running time (Hint: use mathematical induction).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
