Leaves
The number of leaves, the vertices with no children.
✓ checked against that system · ! checked, with disagreements (hover a chip)FindStat
St000201via BinaryTree✓St000167via OrderedTree✓Leaves(tree)The number of leaves, the vertices with no children.Typed signatures
| Type | Package | Applies |
|---|---|---|
(binary_tree | labeled_tree | ordered_tree) -> number | combinatorics | always |
Details
- Defined over
BinaryTreeas an expression in_x, evaluated by compute-engine — the definition IS the implementation. - Takes a
BinaryTreeand nothing else — it reads values against their positions, or walks the orbits, so it needs the bijection. Applying it to a bare list is a type error, not a wrong answer. - Defined over
OrderedTreeas an expression in_x, evaluated by compute-engine — the definition IS the implementation. - Takes a
OrderedTreeand nothing else — it reads values against their positions, or walks the orbits, so it needs the bijection. Applying it to a bare list is a type error, not a wrong answer.
Definition
Epsil, as the implementation runs it.
on BinaryTree, over _x
Apply(
Function(0 if t in Integers else (1 if t[1] in Integers && t[2] in
Integers else 0) +
self(self, t[1]) + self(self, t[2]), self, t),
Function(0 if t in Integers else (1 if t[1] in Integers && t[2] in
Integers else 0) +
self(self, t[1]) + self(self, t[2]), self, t),
_x,
)on OrderedTree, over _x
Apply(Function(
1 if Length(t) == 0 else Sum(Map(Function(self(self, c), c), t)),
self,
t,
), Function(1 if Length(t) == 0 else Sum(Map(
Function(self(
self,
c,
), c),
t,
)), self, t), _x)Examples
Basic #
Properties #
About
| Examples | 9 |
|---|---|
| Crosswalk | FindStat ×2 |