Abstract

When a list of size n is nearly sorted, a straight insertion sort algorithm is highly efficient since only a number of comparisons equal to the number of inversions in the original list, plus at most n − 1, is required. We use a definition of nearly sorted, k-sorted, as given in Berman (1997) and determine the maximum number of inversions in k-sorted permutations of size n. This number is approximately 0.6 kn.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call