private bool IsRightHeavy(AVLNode node) => BalanceFactor(node) < -1;
private bool IsLeftHeavy(AVLNode node) => BalanceFactor(node) > 1;
private int BalanceFactor(AVLNode node) => node == null ? 0 : GetHeight(node.LeftChild) - GetHeight(node.RightChild);
private bool IsLeaf(AVLNode node) => node.LeftChild == null && node.RightChild == null;
private void SetHeight(AVLNode node) { node.Height = 1 + Math.Max(GetHeight(node.LeftChild), GetHeight(node.RightChild)); }
public void Insert(int value) { Root = Insert(Root, value); }