Question:medium

For binary search, the list is in ascending order and the key is present in the list. If the middle element is less than the key, it means:

Show Hint

Binary search halves the search space: if mid<key → go right; if mid>key → go left.
Updated On: Feb 15, 2026
  • The key is in the first half
  • The key is in the second half
  • The key is not in the list
  • The key is the middle element
Show Solution

The Correct Option is B

Solution and Explanation

Step 1: Binary search condition.
In a sorted list (ascending), binary search compares the target key with the middle element.
Step 2: Case analysis.
- If \texttt{mid\_element == key}, the key is found at the middle index.
- If \texttt{mid\_element>key}, the key, if present, must be in the left subarray.
- If \texttt{mid\_element<key}, the key, if present, must be in the right subarray.

Step 3: Apply condition.
Given that the middle element is less than the key, the key must reside in the second half of the list.
Final Answer: \[\boxed{\text{The key is in the second half}}\]
Was this answer helpful?
0