Beispiel: Sortieren mit Suchbäumen

data Tree k = Leaf 
            | Branch (Tree k) k (Tree k)

insert :: Ord k => k -> Tree k -> Tree k

build :: Ord k => [k] -> Tree k
build = foldr ... ...

sort :: Ord k => [k] -> [k]
sort xs = ... ( ... xs )



Johannes Waldmann 2014-07-10