Ian Kelly <ian.g.ke...@gmail.com> writes: > How do you create a tree containing an even number of elements under > this constraint?
That's a good point, I've usually seen different definitions of trees, e.g. data Tree a = Leaf | Branch a (Tree a) (Tree a) so a Leaf node doesn't have a value associated with it. https://en.wikipedia.org/wiki/File:Red-black_tree_example.svg has a picture of such a tree--don't worry about the node coloring for this purpose. Or the multi-way tree with arbitrary branching width: data RoseTree a = RoseTree a [RoseTree a] Each node has a value and a list of zero or more subtrees. -- https://mail.python.org/mailman/listinfo/python-list