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

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