Question:

Which one of the following is the formula used to calculate the middle index in Binary Search?

Show Hint

Modern implementations often use \(low+\frac{high-low}{2}\) to avoid overflow.
Updated On: Jun 8, 2026
  • \(\frac{low + high}{2}\)
  • \(low + high\)
  • \(high - low\)
  • \(\frac{high-low}{2}\)
Show Solution
collegedunia
Verified By Collegedunia

The Correct Option is A

Solution and Explanation

Concept: Binary Search repeatedly divides a sorted list into two halves and checks the middle element.

Step 1:
Understand Binary Search To locate an element efficiently, Binary Search first finds the middle position of the current search range.

Step 2:
Apply middle index formula The middle index is calculated as: \[ mid=\frac{low+high}{2} \] where: \[ low = \text{starting index} \] \[ high = \text{ending index} \] Final Answer: \[ \boxed{\frac{low+high}{2}} \]
Was this answer helpful?
0
0