GATE CS 2021 · Set-1 · Arrays & Matrix Representation

MCQ · 1 mark · Problem PROG-DSTR-0099

Let P be an array containing n integers. Let t be the lowest upper bound on the number of comparisons of the array elements, required to find the minimum and maximum values in an arbitrary array of n elements. Which one of the following choices is correct?
  1. A
    \(t \gt 2n-2\)
  2. B
    \(t \gt 3\lceil \frac{n}{2}\rceil \text{ and } t\leq 2n-2\)
  3. C
    \(t \gt n \text{ and } t\leq 3\lceil \frac{n}{2}\rceil\)
  4. D
    \(t \gt \lceil \log_2(n)\rceil \text{ and } t\leq n\)

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

Show the worked solutionOfficial GATE Answer Key: Option C.See full step-by-step discussion on GateOverflow: https://gateoverflow.in/357450/gate-cse-2021-set-1-question-2

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