I have the following hoccill data definition:
data tree = leaf int | Node in tree tree deriving shows And I have written the following programs to cross the preorder, inorder and post order:
preorder (address n ) = N preorder (node tt1) = [n] ++ preeder tier + preder t1 inser (leaf n) = n inner (node tt1) = inner t + + [n] ++ Insider T1 Post Order (Leaf N) = N Poster (Node NT1) = Post Order T + Post Order T1 ++ [N] I get the error That is: Error in type application *** Expression: preorder t0 + preorder t1 *** Duration: preorder t1 *** Type: Int *** does not match: [A]
Code> I need to return a list which are integers of all trees in the proper order. Any help is highly appreciated because I am new to Haskell.
You int from base case, but [int] < There should also be a list of leaves from the creative case.
Comments
Post a Comment