Binary search is performed on a sorted array of elements (1-indexed). How many comparisons are needed in the worst case?
GATE CSE · Algorithms
Generate diverse GATE-level questions covering divide and conquer paradigm, recursion breakdown, complexity derivation, and algorithm design strategies.
70 questions · 0 PYQs · 20 AI practice · GATE CSE 2027
Binary search is performed on a sorted array of elements (1-indexed). How many comparisons are needed in the worst case?
What is the time complexity of the most efficient algorithm to find the majority element (appears more than times) in an unsorted array?
Binary search reduces the search space by a factor of ______ in each step.
The number of comparisons needed in worst case to search for an element in a sorted array of 1000 elements using binary search is:
Binary search can be applied to which of the following data structures?
What is the time complexity of Binary Search using Divide and Conquer?
Consider binary search on a sorted array . The number of distinct elements that can be found in exactly comparisons is:
The median of elements can be found using a Divide and Conquer algorithm in which of the following time complexities in the worst case?
The recurrence relation has the following asymptotic complexity:
Which of the following problems can be solved using binary search in time?
Which of the following are valid applications of binary search (or the binary search principle)?
What is the minimum number of comparisons required by binary search to find an element in a sorted array of elements in the best case?
Consider a sorted array (0-indexed). Binary search is used to find the element , which is not present. What is the sequence of indices compared (i.e., the sequence of values)?
In a modified merge sort, the array is divided into 3 equal parts. The recurrence T(n) = 3T(n/3) + n gives:
The recurrence relation for the worst-case time complexity of binary search is . Using the Master theorem, the solution is:
The total number of comparisons performed by binary search across all elements of a sorted array of elements (i.e., summing the number of comparisons needed to find each element) in the best case (each element found at the first comparison at its level) is:
Consider applying binary search to find a value in a sorted array. The implementation uses instead of . Why is this preferred?
An array is sorted in ascending order. We want to find if a given target exists using binary search. Consider the following modification: instead of halving the search space, the algorithm divides into three parts (ternary search). What is the worst-case number of comparisons for ternary search compared to binary search?
The number of comparisons required for the comparison-based sort to sort elements in the worst case is at least:
Binary search is applied on a sorted array to find element . The element is present at position in the array. The number of comparisons needed is exactly . This means:
Want unlimited AI-generated Divide And Conquer questions?
Sign up free and practice with adaptive difficulty — Easy, Medium, Hard. New questions every session.
Start practising for free →