Computer Science EngineeringHard

The minimum number of comparisons needed to find both the largest and second-largest of 16 distinct elements (tournament method) is

  1. A. 15
  2. B. 18
  3. C. 17
  4. D. 19

Correct answer: B. 18

The tournament needs n-1 = 15 comparisons plus ceil(log2 n) - 1 = 3 more among the champion's opponents, totalling 18.

More Algorithms, Data Structures & Programming (ISRO CS) questions

Exams that ask this topic