combinat-0.2.4: Generation of various combinatorial objects.




N-ary trees.



derivTrees :: [Int] -> [Tree ()]Source

Computes the set of equivalence classes of trees (in the sense that the leaves of a node are unordered) with n = length ks leaves where the set of heights of the leaves matches the given set of numbers. The height is defined as the number of edges from the leaf to the root.

TODO: better name?

unique labels

addUniqueLabelsTree :: Tree a -> Tree (a, Int)Source

Adds unique labels to a Tree.

addUniqueLabelsForest :: Forest a -> Forest (a, Int)Source

Adds unique labels to a Forest

labelling by depth

labelDepthTree :: Tree a -> Tree (a, Int)Source

Attaches the depth to each node. The depth of the root is 0.