Question:medium

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?

Show Hint

To find a non-maximum element, just compare any two distinct elements — the smaller one is guaranteed to be non-maximum.
Updated On: Feb 9, 2026
  • 1
  • \(N-1\)
  • \(N\)
  • \(2N-1\)
Show Solution

The Correct Option is A

Solution and Explanation

Step 1: Clarify what the problem asks. 
The task is not to determine the maximum element of the list.
Instead, we only need to identify one element that is definitely not the largest.
This requirement makes the problem much simpler than finding the maximum.

Step 2: Use a simple logical insight.
Take any two different elements from the list and compare them.
Between two unequal elements, one must be smaller than the other.
That smaller element cannot possibly be the largest element in the entire list.

Step 3: Count the number of comparisons needed.
Only one comparison is enough:

  • Compare $a_1$ and $a_2$.
  • Select the smaller of the two.

The selected element is guaranteed to be not the maximum, regardless of the rest of the list.
Thus, the same single comparison works in both the best and worst cases.

Step 4: Evaluate the options.
(A) 1: Correct, since one comparison suffices.
(B) $N-1$: Required for finding the maximum, not for finding a non-maximum element.
(C) $N$: Unnecessarily large number of comparisons.
(D) $2N-1$: Not relevant to this task.

Step 5: Final conclusion.
The minimum number of comparisons required is:

\[ \boxed{1} \]

Was this answer helpful?
0