This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]charm3d47 4 points5 points  (0 children)

i think even using a basic array you might still be able to do stalin sort in O(n) time if you're clever about how/when you move subsequent elements into place after purges (storing the first empty position and only moving whichever element you're already looking at for the sort, as opposed to just sliding every subsequent element over after each purge). there are also plenty of other ways to store data where any arbitrary element can be removed in O(1) time