Subscribe with livedoor Reader
Add to My Yahoo!
Twitter Account
This site aims at the support of reuse / the change cycle of the ASCII art (AA). Copy and paste are free. Let's enjoy Ascii Art culture without forgetting respect to other AA craftsmen.

NEW! 2014/06/14 : LINE sticker size was added to the Icon AA.

TwitAA 2012-02-08 02:56:36

Create IconAA

mergeSort :: (Ord a) => [a] -> [a]
mergeSort xs = ms (length xs) xs
where
ms _ [] = []
ms _ [x] = [x]
ms n xs = merge (ms m as) (ms (n - m) bs)
where
m = div n 2
(as, bs) = splitAt m xs
merge xs [] = xs
merge [] ys = ys
merge xs@(x : xs') ys@(y : ys')
| x <= y = x : merge xs' ys
| otherwise = y : merge xs ys'

0
Your rating: None
tweetマージソートだね

Random AA list

Sponsored Links


view counter