in Algorithms edited by
217 views
1 vote
1 vote

The number of comparisons required to find the maximum and minimum element in an array $A[n]$ using Divide and Conquer method is:

  1. $(3n/2)+ 2$
  2. $(3n/2) - 2$
  3. $3n$
  4. $3n/2$
in Algorithms edited by
by
217 views

1 Answer

2 votes
2 votes
Best answer

 Tournament Method Technique -

1. To find the smallest element in the array will take total of n-1 comparisions. (Make pairs , compare them , let the winner move to the next level, keep going till you find the winner)

2. To find the largest element - 

        a.After the first round of Tournament , there will be exactly n/2 numbers that will loose the round.

        b.So the largest number should be among these numbers.To find the largest number will take n/2 - 1 comparisons.

selected by
Answer:

Related questions