N-ary trees.
- derivTrees :: [Int] -> [Tree ()]
- addUniqueLabelsTree :: Tree a -> Tree (a, Int)
- addUniqueLabelsForest :: Forest a -> Forest (a, Int)
- addUniqueLabelsTree_ :: Tree a -> Tree Int
- addUniqueLabelsForest_ :: Forest a -> Forest Int
- labelDepthTree :: Tree a -> Tree (a, Int)
- labelDepthForest :: Forest a -> Forest (a, Int)
- labelDepthTree_ :: Tree a -> Tree Int
- labelDepthForest_ :: Forest a -> Forest Int
Documentation
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 IntSource
addUniqueLabelsForest_ :: Forest a -> Forest IntSource
labelling by depth
labelDepthTree :: Tree a -> Tree (a, Int)Source
Attaches the depth to each node. The depth of the root is 0.
labelDepthForest :: Forest a -> Forest (a, Int)Source
labelDepthTree_ :: Tree a -> Tree IntSource
labelDepthForest_ :: Forest a -> Forest IntSource