Exemple #1
0
        static void RecursionColumnWise()
        {
            var obj = new CareerCupQnA();

            //     [0 0 0 0 0 0 0 1 1 1 1 1]
            //[0 0 0 0 1 1 1 1 1 1 1 1]
            //[0 0 0 0 0 0 1 1 1 1 1 1]
            //[0 0 0 0 0 0 0 0 0 1 1 1]
            //[0 0 0 0 0 0 0 1 1 1 1 1]
            //[0 0 0 0 1 1 1 1 1 1 1 1]
            int[,] array2D = new int[, ] {
                { 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1 },
                { 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1 },
                { 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1 },
                { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1 },
                { 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1 },
                { 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1 },
            };
            obj.RecursionColumnWise(array2D, array2D.GetUpperBound(0), array2D.GetUpperBound(1));
        }