Stalin Sort is an efficient sorting algorithm, serving as a systematic method for placing the elements of a random access file or an array in order. Stalin Sort is also know as the best sorting algorithm of all times because of its AMAZING capacity of always ordering an array with an O(n) performance.
It's simple, all you need to do is iterate through the array, checking if its elements are in order. Any element that isn't in order you pull out, in other words, you send it to Gulag.
Keep in mind that this is pseudocode, and is just an example. We strongly encourage you to code a different approach.
FUNCTION stalinSort(A : list OF sortable items)
n := length(A)
bigger := 0
B SET empty list
FOR i := 0 TO n NOT inclusive DO
IF A[i] >= bigger THEN
bigger := A[i]
B.push(A[i])
END IF
END FOR
RETURN B
END FUNCTION
Please check the CONTRIBUTING.md
Stalin sort began first as a Hacktoberfest 2018 repo
Hacktoberfest is a program organised by Digital Ocean and Github, where you can easily win a T-Shirt just by making 5 pull requests in the month of October to any open source projects on Github.