Ejemplo n.º 1
0
        private void ChartsButton_Click(object sender, EventArgs e)
        {
            ChartsForm chForm = new ChartsForm();

            for (int i = 100; i <= 2000; i += 100)
            {
                int[] bubble = ArraySort.RandomArray(i);
                int[] shaker = new int[i];
                Array.Copy(bubble, shaker, i);
                int compareCount, changeCount;
                ArraySort.BubbleSort(bubble, out compareCount, out changeCount);
                chForm.compareChart.Series[0].Points.AddXY(i, compareCount);
                chForm.changeChart.Series[0].Points.AddXY(i, changeCount);
                ArraySort.ShakerSort(shaker, out compareCount, out changeCount);
                chForm.compareChart.Series[1].Points.AddXY(i, compareCount);
                chForm.changeChart.Series[1].Points.AddXY(i, changeCount);
            }
            chForm.Show();
        }
Ejemplo n.º 2
0
 private void AddRandomButton_Click(object sender, EventArgs e)
 {
     startArr = ArraySort.RandomArray((int)numericUpDown.Value);  // создание массива случайных чисел
     DrawFrame(BubblePictureBox, startArr, -1, -1, -2);
     DrawFrame(ShakerPictureBox, startArr, -1, -1, -2);
 }