Write pseudocode for RIGHT-ROTATE.
RIGHT-ROTATE(T, x)
1 y = x.left
2 x.left = y.right
3 if y.right ≠ T.nil:
4 y.right.p = x
5 y.p = x.p
6 if x.p == T.nil:
7 T.root = y
8 else if x == x.p.left:
9 x.p.left = y
10 else:
11 x.p.right = y
12 y.right = x
13 x.p = y