Sorting algorithm selection