Binary search with selection sort.