Consider a set of 20 elements. To find maximum and minimum element in the given set, the minimum number of comparisons required is _________? (using DAC Max-Min algorithm)
DAC max min algo = >Using Divide and conquer Finding maximum and minimum in a array. T(n) = 0 if n=1 1 if n=2 2T(n/2) +2 if n>2 therefore T(n) = 1.5n - 2 = O(n) for 20 element 1.5*20 -2 = 28
64.3k questions
77.9k answers
244k comments
80.0k users