I'm learning algorithms now, and while implementing red-black tree insertion I came up to the idea described in the question's header. This takes place when equal value nodes are involved.
Let's start with a simple example tree, where left children are less than the parent and right children are greater or equal to the parent.
Initial state of such tree might be the following:
Then, if I rotate this tree left, I get:
The node which violates the BST condition that all left children are less than the parent is shown in red.
So the question is: why lots of algorithms which implement insertion, deletion or else on binary search trees use rotation when rotations break BSTs (or do I just do the rotation wrong)?