find an element in array using binary search