GateAI
Searching

GATE CSE 2025 Set 2 · Q20

MCQ1 markEasy

Time

Consider an unordered list of NN 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?

Select one answerSingle correct

Pick an option to check

Solution

Step-by-step verified solution

Official answer: A) 1

Searching

To find an integer that is guaranteed not to be the largest in a list of NN distinct integers (N≥2N \ge 2):

  1. Select any two arbitrary elements from the list, say aa and bb.

  2. Perform a single comparison between aa and bb.

  3. Whichever element is smaller cannot be the largest element in the list, because there is at least one element (aa or bb) strictly greater than it.

Thus, only 1 comparison is required.

Hence, the correct option is (A).

Try the question first, then check your work.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

This Searching previous year question is Q20 of the GATE CSE 2025 Set 2 paper. Find more GATE CSE PYQs on Searching in Algorithms, or browse all GATE CSE PYQs.

Free diagnostic

Where do you stand for GATE?

Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 1 related Searching PYQs now with no account.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

Searching in GATE CSE

GATE CSE 2025 Set 2 Q20 is the only Searching question in the GATE CSE papers so far.

How GATE tests Searching

More from GATE CSE 2025 Set 2

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2025 Set 2 · Q20 · MCQ

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?

Topic-wise GATE CS PYQs with verified steps

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.