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 算法基础插入排序