コード例 #1
0
        public void MakeConnectedTest1()
        {
            int n = 4;

            int[][] connections    = new int[][] { new int[] { 0, 1 }, new int[] { 0, 2 }, new int[] { 1, 2 } };
            int     expectedResult = 1;
            int     actualResult   = new MakeConnectedClass().MakeConnected(n, connections);

            Assert.AreEqual(expectedResult, actualResult);
        }
コード例 #2
0
        public void MakeConnectedTest4()
        {
            int n = 5;

            int[][] connections = new int[][] { new int[] { 0, 1 }, new int[] { 0, 2 }, new int[] { 3, 4 },
                                                new int[] { 2, 3 } };
            int expectedResult = 0;
            int actualResult   = new MakeConnectedClass().MakeConnected(n, connections);

            Assert.AreEqual(expectedResult, actualResult);
        }