c example: binary search