Example #1
0
 public AvlTreeNode(T value, AvlTreeNode <T> right, AvlTreeNode <T> left, int height)
 {
     _value  = value;
     _right  = right;
     _left   = left;
     _height = height;
 }
Example #2
0
 public AvlTreeNode(T value)
 {
     _value  = value;
     _right  = null;
     _left   = null;
     _height = 0;
 }
Example #3
0
        public AvlTreeNode <T> RotateLeftChild()
        {
            AvlTreeNode <T> n1 = _left;

            _left     = n1._right;
            n1._right = this;
            CalculateHeight();
            n1.CalculateHeight();
            return(n1);
        }
Example #4
0
 public void SetLeft(AvlTreeNode <T> left)
 {
     _left = left;
 }
Example #5
0
 public void SetRight(AvlTreeNode <T> right)
 {
     _right = right;
 }
Example #6
0
 public AvlTreeNode <T> RotateDoubleRight()
 {
     _right = _right.RotateLeftChild();
     return(RotateRightChild());
 }