コード例 #1
0
        private void DebugSamplesButton_Click(object sender, RoutedEventArgs e)
        {
            ArrayProblems aSamples = new ArrayProblems();

            //int[] result = aSamples.IsSumOf2NumsExistsInUnSortedInArray(new int[] {6,4,2,1,3,5,8,7,9 },17);

            int[] result = aSamples.TwoSum(new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }, 19);

            RandomArrayProblems raprbs = new RandomArrayProblems();

            raprbs.Test();
        }
コード例 #2
0
        private void FindAllTripplets_Click(object sender, RoutedEventArgs e)
        {
            string result = ArrayProblems.FindTripletInArray();

            MessageBox.Show("Tripplet in Array result\n" + result);
        }
コード例 #3
0
 private void GetArrayPositionsBasedOnItsElements_Click(object sender, RoutedEventArgs e)
 {
     ArrayProblems.GetArrayPositionsBasedOnItsElements();
 }
コード例 #4
0
 private void FindMissingAndRepeatedNumberDemoButton_Click(object sender, RoutedEventArgs e)
 {
     ArrayProblems.FindMissingAndRepeatedNumbersInArray();
 }
コード例 #5
0
        private void LocalMinimaAndMaximaDemoButton_Click(object sender, RoutedEventArgs e)
        {
            int result = ArrayProblems.FindLocalMinima();

            MessageBox.Show("Local Minima in the array is " + result);
        }