searches an element of sorted array using binary search algorithm