Exemplo n.º 1
0
        public void TestExampleProblemThree()
        {
            /* <1> <2> <3> <4> <5> */

            var arr = new int?[] { null, null, null, null, null };

            var ds = new MdsFinder(arr).ComputeSet();

            ds.Length.ShouldBe(5);
        }
Exemplo n.º 2
0
        public void TestExampleProblemOne()
        {
            /*
             * <1>      <3>
             *       /   \
             *     <5>   [2]
             *     / \
             *   [6] [4]
             */

            var arr = new int?[] { null, 2, null, 4, 2, 4 };
            var ds  = new MdsFinder(arr).ComputeSet();

            ds.Length.ShouldBe(3);
        }
Exemplo n.º 3
0
        public void TestExampleProblemFour()
        {
            /* [6]----<1>-----[5]
            *         /|\
            *        / | \
            *       /  |  \
            *      /   |   \
            *    <2>   |   <4>
            *    / \  [3]  / \
            *  [7] [8]   [9] [10] */

            var arr = new int?[] { null, 0, 0, 0, 0, 0, 1, 1, 3, 3 };

            var ds = new MdsFinder(arr).ComputeSet();

            ds.Length.ShouldBe(3);
        }
Exemplo n.º 4
0
        public void TestExampleProblemTwo()
        {
            /*  [1]
             |
             |  <2>
             |
             |  [3]
             |
             |  <4>
             |
             |  [5] */

            var arr = new int?[] { null, 0, 1, 2, 3 };

            var ds = new MdsFinder(arr).ComputeSet();

            ds.Length.ShouldBe(2);
        }
Exemplo n.º 5
0
        public void TestCounterExample()
        {
            /*  [1]
             |
             |  <2>
             |
             |  [3]
             |
             |  [4]
             |
             |  <5>
             |
             |  [6] */

            var arr = new int?[] { null, 0, 1, 2, 3, 4 };

            var ds = new MdsFinder(arr).ComputeSet();

            ds.Length.ShouldBe(2);
        }