All mock tests are FREE till 31 December — register to save your progress
Unit 7 · Data Structures and Algorithms Paper 2 CS · December 2018

The second smallest of n elements can be found with ____________ comparisons in the worst case.

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: C. n + ⌈log n⌉ − 2

Explanation

A tournament finds the minimum in n − 1 comparisons; the second smallest lost directly to the minimum, among ⌈log n⌉ candidates, needing ⌈log n⌉ − 1 more.

More Data Structures and Algorithms questions