GATE CS 2025 · Set-2 · Linear Search & Binary Search

MCQ · 2 marks · Problem PROG-SRCH-0012

An array \(A\) of length \(n\) with distinct elements is said to be bitonic if there is an index \(1 \leq i \leq n\) such that \(A[1..i]\) is sorted in the non-decreasing order and \(A[i+1..n]\) is sorted in the non-increasing order. Which ONE of the following represents the best possible asymptotic bound for the worst-case number of comparisons by an algorithm that searches for an element in a bitonic array \(A\)?
  1. A
    \(\Theta(n)\)
  2. B
    \(\Theta(1)\)
  3. C
    \(\Theta(\log ^2 n)\)
  4. D
    \(\Theta(\log n)\)

Solve it on GATE DA practice →More Searching & Sorting Algorithms problems

Show the worked solutionOfficial GATE Answer Key: Option D.See full step-by-step discussion on GateOverflow: https://gateoverflow.in/460804/gate-cse-2025-set-2-question-31

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com