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$
- $N-1$
- $N$
- $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.
More Searching, Sorting and Hashing questions
- GATE 2025 CS (CS2) Q41 – An array A of length n with distinct elements is said to be bitonic if there is an index 1…
- GATE 2023 CS Q20 – An algorithm has to store several keys generated by an adversary in a hash table. The…
- GATE 2022 CS Q16 – Suppose we are given n keys, m hash table slots, and two simple uniform hash functions h 1…
- GATE 2021 CS (CS1) Q19 – Consider the following array: [23, 32, 45, 69, 72, 73, 89, 97]. Which algorithm out of the…
- GATE 2019 CS Q30 – An array of 25 distinct elements is to be sorted using quicksort. Assume that the pivot…
- GATE 2019 CS Q50 – Consider the following statements: I. The smallest element in a max-heap is always at a…
All Searching, Sorting and Hashing questions →