GATE CS 2021 Set 1 | Question 12

Algorithms › Algorithm Analysis · MCQ · 1 mark · Answer: C

  1. Question 12Algorithmsmcq1 mark
    Let P be an array containing integers. Let 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 elements. Which one of the following choices is correct?
    • A.
    • B.
      and
    • C.
      and
      ✓
    • D.
      and

    Answer: C

    Solution

    The tournament (pair-wise) method finds both min and max using at most comparisons, and more than are needed, so and .

More GATE PYQ on Algorithm Analysis

All GATE CS Algorithms PYQ →

Attempt GATE CS 2021 Set 1 in real GATE exam mode

Full paper with a timer, the GATE interface and a topic-wise analysis — free.

Create free account →