I was reading an algorithms book which had the following algorithm for binary search:
public class BinSearch { sta
The problem is that (l+u) is evaluated first, and could overflow int, so (l+u)/2 would return the wrong value.
(l+u)
(l+u)/2