public static void AvlMain() { var root = new AvlNode(50, "mike"); root.Dump(); root = root.Insert(60, "simon"); Console.WriteLine(); root.Dump(); root = root.Insert(70, "kevin"); Console.WriteLine(); root.Dump(); Console.WriteLine(); Console.WriteLine(root.Find(70)); }
public void SetParent(AvlNode node) { _parent = node; }
public int GetBalance(AvlNode node) { return(node == null ? 0 : node.LeftHeight - node.RightHeight); }