Binary search in C and Java (so far)