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