Beispiel #1
0
 public static BinaryTreeNode <T> doubleRotateLeft(T root, BinaryTreeNode <T> left, BinaryTreeNode <T> right)
 {
 }
Beispiel #2
0
        public static BinaryTreeNode <T> singleRotateLeft(T root, BinaryTreeNode <T> left, BinaryTreeNode <T> right)
        {
            BinaryTreeNode <T> newLeft = new BinaryTreeNode <T>(root, left.LeftChild, left);

            return(new BinaryTreeNode <T>(right.Data, newleft, right.rightChild));
        }
Beispiel #3
0
 public static BinaryTreeNode <T> doubleRotateRight(T root, BinaryTreeNode <T> left, BinaryTreeNode <T> right)
 {
     T root = left.rightChild.Data;
     BinaryTreeNode <T> newLeft  = new BinaryTreeNode <T>(left.Data, left.leftChild, left.RightChild.LeftChild);
     BinaryTreeNode <T> newRight = new BinaryTreeNode <T>(, left.RightChild.RightChild, right); //need to finish
 }
Beispiel #4
0
        public static BinaryTreeNode <T> singleRotateRight(T root, BinaryTreeNode <T> left, BinaryTreeNode <T> right)
        {
            BinaryTreeNode <T> newRight = new BinaryTreeNode <T>(root, left.RightChild, right);

            return(new BinaryTreeNode <T>(left.Data, left.LeftChild, newRight));
        }