Less than 1 minute
Home > @hz-9/algorithm > AdelsonVelskiiLandiTree > _rotationLR
AdelsonVelskiiLandiTree._rotationLR() method
Left-Right rotation. (Left - Right)
向左的单旋转。(左 - 右)
3 3 2
/ \ / \ / \
1 c4 rotateLeft(1) 2 c4 rotateRight(3) 1 3
/ \ => / \ => / \ / \
c1 2 1 c3 c1 c2 c3 c4
/ \ / \
c2 c3 c1 c2Signature:
protected _rotationLR(node: TreeNode<T>): TreeNode<T>;Parameters
Parameter | Type | Description |
|---|---|---|
node | TreeNode<T> | The node. |
Returns:
TreeNode<T>
The rotated node.