The array has this property that every element in array is at most k distance from its position in sorted array where k is a positive integer smaller than size of array. Which sorting algorithm can be easily modified for sorting this array and what is the obtainable time complexity?
Correct Answer:
Heap Sort with time complexity O(nLogk)
need an explanation for this answer? contact us directly to get an explanation for this answer