public static Node RightRotate(Node root) { var left = root.left; root.left = left.right; left.right = root; root.Count(); left.Count(); #if testing AfterRotation?.Invoke(); #endif return(left); }
public static Node LeftRotate(Node root) { var right = root.right; root.right = right.left; right.left = root; root.Count(); right.Count(); #if testing AfterRotation?.Invoke(); #endif return(right); }