override public void AddNode(int key) { NodeAVL node = new NodeAVL(key); InsertNode(node); CheckAVLPropertyAfterInsertNode(node); }
/*******************************************************************************************/ /*******************************************************************************************/ private void CheckAVLPropertyAfterInsertNode(NodeAVL node) { if (node.IsParent() is false) { return; } NodeAVL child = node; node = ( NodeAVL )node.Parent; while (node != null) { node.IncLevelAVL(child); RestoreAVLProperty(node); child = node; node = ( NodeAVL )node.Parent; } }