in Algorithms retagged by
1,321 views
0 votes
0 votes
Q.13 The minimum number of comparisons required to find the minimum and the maximum of
100 numbers is _________________.

(a) 147.1 to 148.1
(b) 140 to 146

(c)145.1 to 146.1
(d) 140 to 148
in Algorithms retagged by
1.3k views

1 Answer

5 votes
5 votes
Best answer

Minimum no of comparisions =148

selected by

4 Comments

this is using devide and conquer .Actually we can do better than this using straight min-max algo  and minimum number of comparisons will be n-1 =100-1=99 comparisons.Actually in this question nothing is said about so i think 99 is better in this case but looking at the options we can justify that this question has asked using devide and conquer min-max algo.What when options will not be there?
0
0
I think we can find either max or min using 99 comparisions but not both at same time. If you do ,this will eventually increase comparison.
0
0
What is this formula for ????
0
0
edited by

@paraskk if we want to find both minimum and max then we use this formula. if the total no is even then this formula is used

https://gateoverflow.in/1917/gate2014-1-39 

https://gateoverflow.in/1248/gate2007-50

1
1