Skip to content
RED SAG Skills
easyStudy question · answer published in Java interview questions, so no pointsarraysbinary-searchoverflow

Safe midpoint in binary search

In Java or C++, why is mid = lo + (hi - lo) / 2 preferred over (lo + hi) / 2?

Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions