sort array efficiently

I have an array of values which is almost, but not quite sorted, with a few values displaced (say, 50 in 100000). How to sort it most efficiently?


  1. use smoothsort or timsort which performs nearly o(n) when array is partially sorted.


Post a Comment

Popular posts from this blog