Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

There are in-place algorithms that use shifting rather than swapping (the so called in-place merge sort, for instance).

If you look at the result and at the original, generally you will not find many pairs in which the elements exchanged their positions. It takes special initial arrangements for this to be true for all elements.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: