Skip to main content

Does a sorting algorithm's speed depend on how sorted the list already is?

Run the same sorting program on shuffled, nearly sorted and reversed lists and compare the number of steps.