Created
August 20, 2014 03:54
-
-
Save sarathsp06/36cde9dda24e9459f1d0 to your computer and use it in GitHub Desktop.
This file contains 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
--sorting algorithm inspired from quick sort in haskel | |
ksort :: [Int]->[Int] | |
ksort [] = [] | |
ksort (k:a) = ksort [i|i<-a,i<=k]++(k:(ksort [i|i<-a,i>k]) ) | |
main = do | |
input <- getLine | |
let output::[Int] | |
output = read input | |
putStrLn (show (ksort output )) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment