GATE DA 2024 — Question 40

Programming, Data Structures and AlgorithmsSearch algorithms: linear search and binary searchMCQ2 marks · −2/3 if wrongEasy

Let \(F(n)\) denote the maximum number of comparisons made while searching for an entry in a sorted array of size \(n\) using binary search. Which ONE of the following options is TRUE?
  1. A
    \(F(n) = F(\lfloor n/2 \rfloor) + 1\)
  2. B
    \(F(n) = F(\lfloor n/2 \rfloor) + F(\lceil n/2 \rceil)\)
  3. C
    \(F(n) = F(\lfloor n/2 \rfloor)\)
  4. D
    \(F(n) = F(n - 1) + 1\)
Practise the full 2024 paper
Challenge a friend: WhatsApp Telegram
Recommended book · affiliate linkIntroduction to Algorithms (CLRS)The standard reference behind most GATE algorithm questions.
Practise more on Search algorithms: linear search and binary searchTimed, in the real exam interface · free to start

A GATE question every morning

One real past-paper question every morning for your branch, answer hidden until you tap. Free on Telegram.

Join
Stuck? Ask in the student group