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

Reply via email to