public void UnbalancedBstRightHeavy() { tree.Root = new Node <int>(10); tree.Root.Right = new Node <int>(22); tree.Root.Right.Right = new Node <int>(33); Assert.True(Q01 <int> .IsBst(tree)); }
public void IsBst02_EqualNodes() { tree.Root = new Node <int>(10); tree.Root.Left = new Node <int>(10); tree.Root.Right = new Node <int>(10); Assert.True(Q01 <int> .IsBst(tree)); }
public void UnbalancedBstLeftHeavy() { tree.Root = new Node <int>(10); tree.Root.Left = new Node <int>(5); tree.Root.Left.Left = new Node <int>(1); Assert.True(Q01 <int> .IsBst(tree)); }
public void SimpleBst() { tree.Root = new Node <int>(10); tree.Root.Left = new Node <int>(5); tree.Root.Right = new Node <int>(99); Assert.True(Q01 <int> .IsBst(tree)); }
public void NotBst02() { tree.Root = new Node <int>(10); tree.Root.Left = new Node <int>(5); tree.Root.Left.Left = new Node <int>(1); tree.Root.Left.Right = new Node <int>(7); tree.Root.Right = new Node <int>(99); tree.Root.Right.Left = new Node <int>(150); //violates BST property tree.Root.Right.Right = new Node <int>(200); Assert.False(Q01 <int> .IsBst(tree)); }
public void IsBst01() { tree.Root = new Node <int>(10); tree.Root.Left = new Node <int>(5); tree.Root.Left.Left = new Node <int>(1); tree.Root.Left.Right = new Node <int>(7); tree.Root.Right = new Node <int>(99); tree.Root.Right.Left = new Node <int>(55); tree.Root.Right.Right = new Node <int>(100); Assert.True(Q01 <int> .IsBst(tree)); }
public void IsBst03_MoreEqualNodes() { tree.Root = new Node <int>(10); tree.Root.Left = new Node <int>(5); tree.Root.Left.Left = new Node <int>(1); tree.Root.Left.Right = new Node <int>(10); tree.Root.Right = new Node <int>(99); tree.Root.Right.Left = new Node <int>(99); tree.Root.Right.Right = new Node <int>(200); tree.Root.Right.Right.Left = new Node <int>(155); tree.Root.Right.Right.Right = new Node <int>(200); Assert.True(Q01 <int> .IsBst(tree)); }
public void NoRoot() { Assert.False(Q01 <int> .IsBst(tree)); }
public void RootOnly() { tree.Root = new Node <int>(5); Assert.True(Q01 <int> .IsBst(tree)); }
public void VerifyBst() { Assert.True(Q01 <int> .IsBst(exampleTree)); }