Skip to content

Python implementation of the StalinSort algorithm.

License

Notifications You must be signed in to change notification settings

Gagis/stalinsort

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

stalinsort

Sorts iterable according to the single pass O(n) StalinSort algorithm.

Example

from stalinsort import stalinsort
a = [3, 2, 5, 7, 1, 3]
stalinsort(a)
[3, 2, 1]

References

@mathew@mastodon.social (2018/10/26 04:20:16)

I came up with a single pass O(n) sort algorithm I call StalinSort. You iterate down the list of elements checking if they're in order. Any element which is out of order is eliminated. At the end you have a sorted list.

About

Python implementation of the StalinSort algorithm.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages