I\'ve seen programmers use the formula
mid = start + (end - start) / 2
instead of using the simpler formula
mid = (start +
start + (end-start) / 2 can avoid possible overflow, for example start = 2^20 and end = 2^30