26 Feb
2001
26 Feb
'01
2:05 p.m.
Hello I'm a haskell newbie that tries to create a tree with arbitary numbers of childs. I create the data structure but i can't do anything on it can someone please help me with a small function that sums the values of the leafs, so i don´t loose my hair so fast. The datastructure looks like this and a binary tree built with it would look like this: data GeneralTree = Nil | Node (Integer,[GeneralTree]) tree = (20, [ (-20,[(30,[Nil]),(20,[Nil])]), (40,[(65,[Nil]),(-40,[Nil])]) ] ) Best regards Martin Gutsfsson