Binary search uses inclusive bounds low = 1 and high = 9. Using low + floor((high - low) / 2), what is mid?
Answer & explanation
Answer: 5
The difference is eight, so the midpoint is four positions above low.
Practice binary search with self-contained questions. Check your answer, then use the explanation to understand the reasoning.
Answer: 5
The difference is eight, so the midpoint is four positions above low.