public void Insert(int value)//logn { if (value > Data) { if (Right != null) { Right.Insert(value); } else { Right = new AVL(value); Right.Mum = this; Right.SetTree(tree); Console.WriteLine("found_place"); tree.Print_tree(); tree.Height_print(); Right.Cal_heigh(); } } else { if (Left != null) { Left.Insert(value); } else { Left = new AVL(value); Left.Mum = this; Left.SetTree(tree); Console.WriteLine("found_place"); tree.Print_tree(); tree.Height_print(); Left.Cal_heigh(); } } }
public void Insert(int value)//Insert(T value) { if (root == null) { root = new AVL(value); root.SetTree(this); } else { root.Insert(value); } }
public AVL_Tree(AVL left, int data, AVL right)//AVL_Tree(AVL left, T data, AVL right) { root = new AVL(data, right, left); root.SetTree(this); }
public AVL_Tree(int data)//AVL_Tree(T data) { root = new AVL(data); root.SetTree(this); }