ExamLookup
Menu mobile
Home
Current Affairs
General Knowledge
Computer
Python
HTML
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
A.
θ(n log n)
θ(n log n)
B.
θ(n)
θ(n)
C.
θ(log n)
θ(log n)
D.
θ(1)
θ(1)
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