Define a data type for trees that can have:
leaves, of size 0
unary nodes, of size 1 + size of child
binary nodes, of size 2 + size of children
ternary nodes, of size 3 + size of children
Write a Haskell program that generates all the trees of size n.
Write a Pyhton program that does the same.
9 freelancers are bidding on average $26 for this job
Hi, i'm a functional language expert. I'been working with Haskell and Python for a long time. I can do your work for you! You can contact me for more information.
Hello. As far as I understand, you mean following datatype data Tree = Leaf | T1 Tree | T2 Tree Tree | T3 Tree Tree and want all trees of size /exactly/ n. If this is correct, sure, I can do it.