Why does mid = (left + right) / 2 fail in Java binary search on large arrays, and how do you avoid it cleanly?
When left + right exceeds Integer.MAX_VALUE (2,147,483,647), signed 32-bit addition wraps negative and throws ArrayIndexOutOfBoundsException. Computing left + (right - left) / 2 or (left + right) >>> 1 guarantees overflow-safe midpoint calculation.
✓ AI Panelist Follow-Up Evaluation: Crisp Java primitive safety explanation. Follow-up: when would you pick ArrayDeque over LinkedList for BFS?