GATE : Computer Science and IT

An unordered list contains n distinct elements. The number of comparisons to find an element in this list that is neither maximum nor minimum is , An unordered list contains n distinct elements. The number of comparisons to find an element in this list that is neither maximum nor minimum is

An unordered list contains n distinct elements. The number of comparisons to find an element in this list that is neither maximum nor minimum is




Solution
D. θ(1)



Explanation
Ans Θ(1), because all elements are distinct, select any three numbers and output 2nd largest from them.
CCC Online Test 2021 CCC Practice Test Hindi Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Exam Quiz Website development Company in Allahabad