red-black trees (againyou'll need color flip before you insert the the result is shown in figure note that the node is an inside grandchild it and its parent are both redso again you see the error message errorparent and child both red fixing this arrangement is slightly more complicated if we try to rotate right with the grandparent node ( at the topas we did in possibility the inside grandchild ( moves across rather than upso the tree is no more balanced than before (try thisthen rotate backwith at the topto restore it different solution is needed the trick when is an inside grandchild is to perform two rotations rather than one the first changes from an inside grandchild to an outside grandchildas shown in figures and now the situation is similar to possibility and we can apply the same rotationwith the grandparent at the topas we did before the result is shown in figure acolor change color change rotation rotation figure is red and is an inside grandchild