Data Structures

1:

An array of n numbers is given, where n is an even number. The maximum as well as the minimum of these n numbers needs to be determined. Which of the following is TRUE about the number of comparisons needed?

A.

At least 2n-c comparisons, for some constant c, are needed.

B.

At most 1.5n-2 comparisons are needed.

C.

At least nlog2n comparisons are needed.

D.

None of the above.

 

Answer : B

Explanation :

Aparna said: (11:08pm on Thursday 25th June 2015)
what would be the case if n is odd?

Write your comments here:


Report Error
 

Option: A

Explanation : Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here.