edited by
53,591 views
89 votes
89 votes
The minimum number of comparisons required to find the minimum and the maximum of $100$ numbers is ________
edited by

16 Answers

1 votes
1 votes

Make pair of elements and compare value in pair, which is greater or which is smaller ?. We have 50 such pairs, then we need 50 comparisons to separate all number in two groups. One group of smaller element from each pair and one group of larger elements from each pair both containing 50 elements each

To find minimum in smaller element group of 50 elements will take 49 comparisons.

To find maximum in greater element group of 50 elements will take 49 comparisons. 

Total comparisons = 50 + 49 + 49 = 148 

 

 

0 votes
0 votes
Use formulae

(3n/2 -2)

in this question

3(100)/2 -2 = 300/2 -2 = 150 -2 = 148
0 votes
0 votes
compare in pairs like- compare arr[0],arr[1] and arr[1],arr[2] ….. total 50 comparisions

for each comparison store bigger one in A list and smaller one in B list

maximum of arr will be in A and min will be in B, finding max in A and min in B each will take 49 comparisions

total 50+49+49=148
0 votes
0 votes
We are given 100 elements so make a group of 2-2 elements, find min and max from each and store min element in one array and max element in another array, This will take 50 comparisons.

Now we will have 50-50 elements in both min and max array.

total 49 comparisons required in each to find min and max.

so total comparisons=50+49+49=148
edited by
Answer:

Related questions

0 votes
0 votes
1 answer
2
Raghav Khajuria asked Oct 13, 2018
322 views
Minimum no of comparisons required to find the minimum and maximum of n distinct elements
1 votes
1 votes
1 answer
3
mystylecse asked Aug 15, 2017
3,449 views
The minimum number of comparisons required to find the minimum and maximum of 60 numbers is..............
0 votes
0 votes
1 answer
4
Aspi R Osa asked Dec 14, 2015
1,509 views
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)...