An array of n numbers is given, where n is an even number. The maximum as well…

PYQ GATE 2007

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?

  1. A.

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

  2. B.

    At most 1.5n - 2 comparisons are needed.

  3. C.

    At least nLog2n comparisons are needed.

  4. D.

    None of the above.

Attempted by 326 students.

Sign up free to check your answer

Sign up free

Explore the full course: Algorithms

Loading lesson…