The GATE Grind

GATE 2025 CS (CS2) – Question 20

Algorithms · Searching, Sorting and Hashing · 1 mark · Multiple choice

Consider an unordered list of $N$ distinct integers.

What is the minimum number of element comparisons required to find an integer in the list that is NOT the largest in the list?

  1. $1$
  2. $N-1$
  3. $N$
  4. $2N-1$

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: (A) $1$

Explanation

Compare any two elements. The smaller one is certainly not the largest, so one comparison suffices.