red-black trees black node figure red node red node balanced tree alsoit' easier to fix violations of rule (parent and child are both redthan rule (black heights differ)as we'll see later experiment rotations let' try some rotations start with the three nodes as shown in figure position the red arrow on the root ( by clicking it with the mouse this node will be the top node in the rotation now perform right rotation by pressing the ror button the nodes all shift to new positionsas shown in figure arrow figure following right rotation in this right rotationthe parent or top node moves into the place of its right childthe left child moves up and takes the place of the parentand the right child moves down to become the grandchild of the new top node notice that the tree is now unbalancedmore nodes appear to the right of the root than to the left alsothe message indicates that the red-black rules are violatedspecifically rule (the root is always blackdon' worry about this problem yet insteadrotate the other way position the red arrow on which is now the root (the arrow should already point to after the previous rotationclick the rol button to rotate left the nodes will return to the position of figure