Exemplo n.º 1
0
        public void IsBinaryTree_FalseRight()
        {
            var tree = new Node(4)
            {
                left = new Node(2)
                {
                    left = new Node(7), right = new Node(3)
                }, right = new Node(6)
                {
                    left = new Node(5), right = new Node(2)
                }
            };

            Assert.AreEqual(false, BinaryTreeCheck.IsBinaryTree(tree));
        }
Exemplo n.º 2
0
        public void IsBinaryTree()
        {
            var tree = new Node(4)
            {
                left = new Node(2)
                {
                    left = new Node(1), right = new Node(3)
                }, right = new Node(6)
                {
                    left = new Node(5), right = new Node(7)
                }
            };

            Assert.AreEqual(true, BinaryTreeCheck.IsBinaryTree(tree));
        }