position the arrow on the root now press ror wow(or is it wow? lot of nodes have changed position the result is shown in figure here' what happensthe top node ( goes to its right child the top node' left child ( goes to the top the entire subtree of which is the root moves up the entire subtree of which is the root moves across to become the left child of the entire subtree of which is the root moves down you'll see the errorroot must be black messagebut you can ignore it for the moment you can flip back and forth by alternately pressing ror and rol with the arrow on the top node do this and watch what happens to the subtreesespecially the one with as its root in figure the subtrees are encircled by dotted triangles note that the relations of the nodes within each subtree are unaffected by the rotation the entire subtree moves as unit the subtrees can be larger (have more descendantsthan the three nodes we show in this example no matter how many nodes there are in subtreethey will all move together during rotation human beings versus computers at this pointyou've learned pretty much all you need to know about what rotation does to cause rotationyou position the arrow on the top node and then press ror or rol of coursein real red-black tree insertion algorithmrotations happen under program controlwithout human intervention notice however thatin your capacity as human beingyou could probably balance any tree just by looking at it and performing appropriate rotations whenever node has lot of left descendants and not too many right onesyou rotate it rightand vice versa unfortunatelycomputers aren' very good at "just lookingat pattern they work better if they can follow few simple rules that' what the red-black scheme providesin the form of color coding and the four color rules inserting new node now you have enough background to see how red-black tree' insertion routine uses rotations and the color rules to maintain the tree' balance