first implementation of binary search in C using pointers