Example #1
0
 private void CombinationOfSizeR_Click(object sender, EventArgs e)
 {
     int[] values = { 1, 2, 3 };
     IntProblem.combinationOfSizeR(values, new int[3], 0, 3, 0, 2);
     Console.WriteLine("Another approach-----------");
     IntProblem.combinationOfSizeR_AnotherApproach(values, new int[3], 0, 3, 0, 2);
 }
Example #2
0
 private void FindNumberInSortedMatrix_Click(object sender, EventArgs e)
 {
     int[,] array = new int[, ] {
         { 1, 8, 12, 19 }, { 22, 25, 29, 31 }, { 33, 36, 39, 42 }, { 44, 56, 73, 82 }
     };
     IntProblem.findValueInSortedMatrix(array, 73, 4, 4);
     //ArrayProblems.TraverseMatrix (array, 1, 1, 3, 1);
 }
Example #3
0
        private void MergeTwoSortedArray_Click(object sender, EventArgs e)
        {
            int[] array1 = new int[16];
            array1[0]  = 1;
            array1[1]  = 9;
            array1[2]  = 8;
            array1[3]  = 12;
            array1[4]  = 19;
            array1[5]  = 22;
            array1[6]  = 25;
            array1[7]  = 29;
            array1[8]  = 31;
            array1[9]  = 73;
            array1[10] = 82;

            int[] array2 = new int[] { 3, 33, 36, 39, 42, 44 };

            IntProblem.mergeTwoSortedArray(array1, array2, 11, 5);
        }
Example #4
0
 private void PrintPrime_Click(object sender, EventArgs e)
 {
     IntProblem.PrintAllPrimeNumbers(10);
 }
Example #5
0
 private void factorial_Click(object sender, EventArgs e)
 {
     Console.WriteLine("#### Factorial of 4: " + IntProblem.factorial(4));
 }
Example #6
0
 private void intProblem_Click(object sender, EventArgs e)
 {
     IntProblem.sumOfTwoEqualK();
     IntProblem.sumOfTwoEqualKDict();
     IntProblem.sumOfThreeEqualK();
 }
Example #7
0
 private void button2_Click(object sender, EventArgs e)
 {
     IntProblem.getMaxSumInASequenceNegetive();
 }
Example #8
0
 private void subarray_sum_Click(object sender, EventArgs e)
 {
     int[] arr = { 1, 2, 3 };
     IntProblem.combinationRecursive(arr);
     IntProblem.subArraySum(arr, 33);
 }
Example #9
0
 private void CombinationOfSum_Click(object sender, EventArgs e)
 {
     int[] values = { 5, 4, 3, 2, -1, -2 };// {3, 4,6,7,2,10,21,29,8, 5, 1};
     IntProblem.subset_Sum(values, new int[6], 6, 0, 5, 0);
 }
Example #10
0
 private void FibonacciBetweenRange_Click(object sender, EventArgs e)
 {
     IntProblem.FibonacciSeriesBetweenRange(3, 55);
 }
Example #11
0
 private void Fibonacci_Click(object sender, EventArgs e)
 {
     IntProblem.FibonacciSeries(10);
 }
Example #12
0
 private void button1_Click(object sender, EventArgs e)
 {
     int[] array = { 10, 12, 17, -10, 9, 11, 2, 14, 22, 11, 22 };
     IntProblem.getSequenceOfIncreasingOrderNumber(array);
 }
Example #13
0
 private void MaxOfTwo_Click(object sender, EventArgs e)
 {
     IntProblem.getMaxValue(10, 5);
 }