GATE DA 2024 · Question 40 · Programming, Data Structures and Algorithms · Multiple choice (MCQ) · 2 marks · −2/3 for a wrong answer
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 ?
- (A) F(n) = F(⌊ n/2 ⌋) + 1
- (B) F(n) = F(⌊ n/2 ⌋) + F(⌈ n/2 ⌉)
- (C) F(n) = F(⌊ n/2 ⌋)
- (D) F(n) = F(n-1) + 1
Answer
Answer (A)
Answer from the official GATE DA 2024 answer key.
The step-by-step solution, where available, is part of GATE DA Pro. See what Pro includes