[#BloombergLP-bslalg-RbTreeUtil-rotateRight]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslalg.adoc[bslalg]::xref:BloombergLP/bslalg/RbTreeUtil.adoc[RbTreeUtil]::rotateRight
:relfileprefix: ../../../
:mrdocs:

Rotate `node` clockwise about its left child&period;

== Synopsis

Declared in `&lt;bslalg&lowbar;rbtreeutil&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
void
rotateRight(xref:BloombergLP/bslalg/RbTreeNode.adoc[RbTreeNode]* node);
----

== Description

Perform clockwise rotation on the specified `node`&colon; Rotate the node&apos;s left child (the pivot) to be the node&apos;s parent, and attach the pivot&apos;s right child as the node&apos;s left child&period; &grave; (node) (pivot) &sol; &sol; &period; (pivot) c &hyphen;&hyphen;&hyphen;&gt; a (node) &sol; &sol; &period; a b b c &grave; The behavior is undefined unless `node&hyphen;&gt;leftChild()` is not 0, `node&hyphen;&gt;parent()` is not 0, and node&apos;s parent refers to `node` as one of its children&period; Note that this operation maintains the ordering of the subtree rooted at `node`&period; Also note this operation will successfully rotate the root node of an unbalanced, but otherwise well&hyphen;formed, tree referred to by a `RbTreeAnchor` object (see `isWellFormed`) because the parent of the root node is the tree&apos;s sentinel node (i&period;e&period;, not 0), which refers to the root node as its left child, and an `RbTreeAnchor` object returns the left child of the sentinel node as the root of the tree&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *node*
| node to rotate clockwise
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
