Question.3
A developer computes the midpoint in binary search:
int mid = (low + high) / 2;
For very large arrays (e.g., low = 1,500,000,000 and high = 2,000,000,000 on a system where int is 32-bit signed), what can go wrong?
low = 1,500,000,000
high = 2,000,000,000
int
Select Answer
Nothing — integer division always works correctly
low + high overflows int (exceeds 2,147,483,647), producing a negative value — mid becomes wrong
The division produces a floating-point result that gets truncated
Only fails on 16-bit MCUs, not 32-bit