public static bool Contains(AvlNode <T> node, T value) { if (node == null) { return(false); } var compareResult = value.CompareTo(node.Value); if (compareResult < 0) { return(Contains(node.Left, value)); } else if (compareResult > 0) { return(Contains(node.Right, value)); } return(true); }
public bool Add(T value) { return(AvlNode <T> .Add(ref this.root, value)); }
public bool Contains(T value) { return(AvlNode <T> .Contains(this.root, value)); }
public static void RotateLeft(ref AvlNode <T> node) { Rotate(ref node, 1, 0); }
public static void RotateRight(ref AvlNode <T> node) { Rotate(ref node, 0, 1); }
public static int GetHeight(AvlNode <T> node) { return(node == null ? 0 : node.height); }
public static int GetSize(AvlNode <T> node) { return(node == null ? 0 : node.size); }