Implements Binary search.