What is the worst-case number of arithmetic operations performed by recursive binary search on a sorted array of size n?
(A) Θ(√n)
(B) Θ(log2(n))
(C) Θ(n2)
(D) Θ(n)
Answer: (B)
Explanation: Arithmetic operations performed by binary search on sorted data items means computation of mid element required arithmetic operation. So it will be computed log(n) time and Hence option (C) will be correct.
Quiz of this Question
Level Up Your GATE Prep!
Embark on a transformative journey towards GATE success by choosing
Data Science & AI as your second paper choice with our specialized course. If you find yourself lost in the vast landscape of the GATE syllabus, our program is the compass you need.