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