Exemple #1
0
        public void LCA_NodeAreCorrect02()
        {
            Node node1 = new Node(null, 1);

            Node node2 = new Node(node1, 2);
            Node node3 = new Node(node1, 3);

            Node node4 = new Node(node2, 4);
            Node node5 = new Node(node2, 5);

            Node node6 = new Node(node3, 6);
            Node node7 = new Node(node3, 7);

            Node node8 = new Node(node4, 8);
            Node node9 = new Node(node4, 9);


            var lcaNode = Task03.Lca2(node3, node7);

            Assert.AreEqual(node3, lcaNode);
        }
Exemple #2
0
        public void LCA_WhenGivenInputIsNotCorrect_1()
        {
            var lcaNode = Task03.Lca2(null, null);

            Assert.AreEqual(null, null);
        }