GATE CS 2007 · Arrays & Matrix Representation

MCQ · 1 mark · Problem PROG-DSTR-0196

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 2 nlog n comparisons are needed.
  4. D
    None of the above.

Solve it on GATE DA practice →More Basic Data Structures problems

Show the worked solutionOfficial GATE Answer Key: Option B.See full step-by-step discussion on GateOverflow: https://gateoverflow.in/1248/gate2007-50

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com