2 ms·
https://gist.github.com/pdkl95/e97749edc3ba58825a16#file-bash_only_mergesort-bash https://gist.github.com/pdkl95/e97749edc3ba58825a16#file-bas... I what must b
by pdkl95 12y ago
https://gist.github.com/pdkl95/e97749edc3ba58825a16#file-bash_only_mergesort-bash https://gist.github.com/pdkl95/e97749edc3ba58825a16#file-bas...
I what must be a lapse of sanity, I wrote mergesort. It is quite a bit more than 3 - err, 14 - lines, but it does include an option to see view the array nesting.
It uses slightly better array management... and then throws out any gains by rebuilding a new array every time an element is shift off the front.
// for when you really don't want to use sort(1)