In-place sort (one script)

  scripts
  sprites
See inside
Notes and Credits

2015/02/19 - UPDATE: couple of very slight speed tweaks.

This is a much simpler sorting algorithm than the others I made, and it's also in-place (meaning it doesn't use any other lists than the one that's being sorted).

I decided to also aim to make it a single script, so it's very easy to import into other projects. :)

It's basically a slightly modified recursive QuickSort, with something like a Selection-Sort once the 'chunks' get small enough.

It does not require any extra lists, though it does append on the end of the list being sorted as a temporary stack during the recursion.

It's simple enough that it took less than a couple of hours to put it all together. Plenty of comments inside, too...

Shared: 18 Feb 2015 Modified: 19 Feb 2015
Favorite this project 22
Love this project 35
Total views 488
View the remix tree  1
  
More projects by TheLogFather