Last active
July 30, 2019 16:11
-
-
Save yonta/63f5eacf7b596b41c5f44abcdae8394c to your computer and use it in GitHub Desktop.
粛清だ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun stalinSort nil = nil | |
| stalinSort (h::t) = | |
let | |
fun sort _ nil = nil | |
| sort x (h::t) = | |
if x < h then h :: sort h t | |
else sort x t | |
in | |
h :: sort h t | |
end | |
fun stalinSort2 nil = nil | |
| stalinSort2 (l as [_]) = l | |
| stalinSort2 (t1 :: (h1 as (t2 :: h2))¡= | |
if t1 < t2 then t1 :: stalinSort2 h1 | |
else stalinSort2 (t1 :: h2) | |
fun neoStalinSort _ = nil |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment