StackOverflow 文件 algorithm 教程 插入排序 Haskell 實現 Haskell 實現 Created: November-22, 2018 insertSort::Ord a => [a] -> [a] insertSort [] = [] insertSort (x:xs) = insert x (insertSort xs) insert::Ord a => a-> [a] -> [a] insert n [] = [n] insert n (x:xs) | n <= x = (n:x:xs) | otherwise = x:insert n xs 演算法基礎插入排序