Example #1
0
 public static BinaryTreeNode <T> LeftRotation <T>(this BinaryTreeNode <T> root)
 {
     return(null);
 }
Example #2
0
 public static int BalanceFactor <T>(this BinaryTreeNode <T> root)
 {
     return(Height(root.left) - Height(root.right));
 }
Example #3
0
        public static bool IsBalance <T>(this BinaryTreeNode <T> root)
        {
            int balanceFactor = root.BalanceFactor();

            return(-1 <= balanceFactor && balanceFactor <= 1);
        }
Example #4
0
 public BinaryTreeNode(T value, BinaryTreeNode <T> left, BinaryTreeNode <T> right)
 {
     this.value = value;
     this.left  = left;
     this.right = right;
 }