Skip to content
GATEiit

GATE DA 2025 Q27: When does binary search run in O(log n)?

Question

For which of the following inputs does binary search take time O(log⁡n)O(\log n) in the worst case?

Try it: multiple select: one or more correct options

Select one or more options
Select all correct options. No negative marking, no partial marks.
Show answer and explanation

Answer: C (official GATE 2025 final answer key)

Concept used: Binary search needs sorted input and constant-time access to the middle element.

First step: Ask two questions for each option: is the data sorted, and can you jump to the middle element in O(1)O(1) time?

Full step-by-step solution

Detailed working, common mistakes and linked mock tests will be available with a free GATEiit account. Log-in is coming soon.

Share this question

WhatsAppDownload image

Source: official GATE 2025 DA question paper and final answer key, organised by IIT Roorkee. Question paper · Answer key