Example #1
0
 public static BinaryTreeNode <T> doubleRotateLeft(T root, BinaryTreeNode <T> left, BinaryTreeNode <T> right)
 {
 }
Example #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));
        }
Example #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
 }
Example #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));
        }