Binary search implementation for array