Filter by year

Binary Search questions

Q31

GATE DA 2026 DASearching and SortingNAT1 mark

Report a problem with Q31

What is wrong?
Let A be a sorted array containing 1000 distinct integers. You perform a recursive binary search on A to find an element y. Suppose each comparison checks whether the middle element computed during the current recursive step is equal to, less than, or greater than y.
The maximum number of comparisons that may have to be performed if y is not an element of A is _______ . (Answer in integer)
Show answer without attempting

Loading the answer…

Q27

GATE DA 2025 DASearching and SortingMSQ1 mark

Report a problem with Q27

What is wrong?
For which of the following inputs does binary search take time O(log⁡n)O(\log n) in the worst case?
More than one option can be correct.
Show answer without attempting

Loading the answer…

Q40

GATE DA 2024 DASearching and SortingMCQ2 marks−2/3 if wrong

Report a problem with Q40

What is wrong?
Let F(n)F(n) denote the maximum number of comparisons made while searching for an entry in a sorted array of size nn using binary search.

Which ONE of the following options is TRUE?
Show answer without attempting

Loading the answer…

0/30 correct0 marks

Related topics in Searching and Sorting