RightRotation
Rotate the root to the right: the left child becomes the root, the root its right child.
FindStat
Mp00019via BinaryTreeRightRotation(BinaryTree)Rotate the root to the right: the left child becomes the root, the root its right child.Typed signatures
| Type | Package | Applies |
|---|---|---|
(binary_tree) -> binary_tree | combinatorics | always |
Details
- Takes a
BinaryTreeand returns aBinaryTree— a typed map, so a wrong carrier is a type error rather than a wrong answer. - FindStat's Mp00019. A tree whose root has no left child has nothing to rotate; FindStat then moves its right subtree to the left, as [A, .], and so do we. That makes it a bijection on every size, inverse to LeftRotation.
Examples
About
| Examples | 1 |
|---|---|
| Crosswalk | FindStat |