in Algorithms edited by
1,059 views
0 votes
0 votes

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)

in Algorithms edited by
1.1k views

1 Answer

0 votes
0 votes
Best answer

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

               

selected by

1 comment

28 is the right answer . To find maximum and minimum element we can use the equation (3n/2)-2
Here n=20 so
Answer is 28
0
0
Answer:

Related questions