Let P be an array containing \(n\) integers. Let \(t\) be the lowest upper…

PYQ GATE 2021

Let P be an array containing nn  integers. Let tt  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 nn  elements. Which one of the following choices is correct?

  1. A.

    t>2n−2t > 2n - 2

  2. B.

    t>3⌈n2⌉and t≤2n−2t > 3 \lceil{\frac {n} {2} \rceil} and \ t \leq 2n - 2

  3. C.

    t>n  and t≤3⌈n2⌉t > n \ \ and \ t \leq 3\lceil {\frac {n}{2}} \rceil

  4. D.

    t>⌈log2(n)⌉and t≤nt > \lceil {log_2 (n)} \rceil and \ t \leq n

Attempted by 179 students.

Sign up free to check your answer

Sign up free

Explore the full course: Algorithms

Loading lesson…