Algorithm Efficiency and Sorting