Consider an unordered list of 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?
GATE CSE 2025Algorithms › Sorting AlgorithmsVerified
(A) 1 1 1
Because all integers are distinct, compare any two elements. The smaller of the two cannot be the largest in the entire list, so one comparison is sufficient. Zero comparisons cannot guarantee a non-largest element, making 1 the minimum.
The minimum number of comparisons is 1, because comparing any two distinct elements identifies the smaller one, which cannot be the largest in the whole list. No comparison-free algorithm can guarantee a non-largest element. Hence option A is correct.
Reviewed by GateIQ Editorial Team: IIT & IISc Alumni.