BinaryTreeParentArray
The singular-inhabitant constructor for a binary tree as its in-order parent array: entry k is the k-th node's parent, 0 at the root.
BinaryTreeParentArray(list)The singular-inhabitant constructor for a binary tree as its in-order parent array: entry k is the k-th node's parent, 0 at the root.Typed signatures
| Type | Package | Applies |
|---|---|---|
((list<integer>) -> binary_tree_parent_array) & ((binary_tree) -> binary_tree_parent_array) | combinatorics | always |
Details
- Number the nodes in order. A node numbered below its parent is its left child, above it its right, so parentage alone fixes the tree: is a root 2 with left child 1 and right child 3, and 4 to the right of 3.
- A binary search tree's values are its in-order numbers, which makes this what
BinarySearchTreeParentArraybuilds. The same structure as aBinaryTree(BinaryTree(array),BinaryTreeParentArray(tree)), and through it a Dyck path.
Maps
Into and out of BinaryTreeParentArray, called as CombinatorialMap(x, "Name"). Properties are the laws we state and what FindStat records.
From BinaryTreeParentArray
- BinaryTreeBinaryTreeParentArray → BinaryTreeinverseThe binary tree an in-order parent array describes: a node below its parent goes left, above it right.
To BinaryTreeParentArray
- BinarySearchTreeParentArrayPermutation → BinaryTreeParentArrayThe binary search tree of σ as its parent array: entry v is the value v is inserted under, 0 for the root.
- BinaryTreeParentArrayBinaryTree → BinaryTreeParentArrayinverseA binary tree as its parent array: its nodes numbered in order, entry k the number of the k-th node's parent, 0 at the root.
Examples
About
| Examples | 1 |
|---|
See also: BinaryTreeParentArrays, BinaryTree