public static void IsBinarySearchTree_HandlesDeeperValid() { var root = BinaryTreeStringUtil.Create("[4] [1 *] [* 2 * *] [* * * 3 * * * *]"); Assert.That(IsBinarySearchTree.ValidateBinarySearchTree(root), Is.EqualTo(true)); }
public static void IsBinarySearchTree_HandlesDuplicates() { var root = BinaryTreeStringUtil.Create("[4] [1 *] [* 2 * *] [* * 1 3 * * * *]"); Assert.That(IsBinarySearchTree.ValidateBinarySearchTree(root), Is.EqualTo(false)); }
public static void IsBinarySearchTree_HandlesBasicInvalid() { var root = BinaryTreeStringUtil.Create("[4] [2 *] [1 8 * *]"); Assert.That(IsBinarySearchTree.ValidateBinarySearchTree(root), Is.EqualTo(false)); }