Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sp :: [Integer] -> [Integer]
- sp (x:y:ys)
- | x > y = y : sp (x : ys)
- | otherwise = x : sp (y : ys)
- sp xs = xs
- srt :: [Integer] -> [Integer]
- srt xs
- | xs == sp xs = xs
- | otherwise = srt $ sp xs
- main :: IO [Integer]
- main = return $ srt [500,499 .. 0]
- -- real 0m0,003s
- -- user 0m0,000s
- -- sys 0m0,003s
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement