Tree Rotation

This is important to understand, as it is how we rebalance trees. Needed for example in AVL Tree, as seen in CS240.

Here are the different rotations that you can do:

Rotation