Implements binary search on rotated array