我必须实现预订树遍历: (Knoten'A'(Blatt'B')(Blatt'C'))的结果必须是['A','B','C']
这是我的代码,但我无法找到错误:
data Baum a = Blatt a | Knoten a
(Baum a)
(Baum a)
preorder (Blatt () ) = []
preorder (Knoten a l r) = [a] ++ preorder l ++ preorder r