private void StartSorting(object sender, EventArgs e)
        {
            sem = 0;

            cts  = new CollectionToSort(test, SwapCost, ComparisonCost);
            cts2 = new CollectionToSort(test2, SwapCost, ComparisonCost);

            Graphics graphic = Graphics.FromImage(pctbox_drawingArea.Image);

            graphic.Clear(Color.White);

            Graphics graphic2 = Graphics.FromImage(pctbox_drawingArea2.Image);

            graphic2.Clear(Color.White);


            Bitmap  = new Bitmap(pctbox_drawingArea.Width, pctbox_drawingArea.Height);
            Bitmap2 = new Bitmap(pctbox_drawingArea2.Width, pctbox_drawingArea2.Height);

            ChooseFillType();
            test2.ColoneCoe(test);

            cts.DrawElements();
            cts2.DrawElements();

            tmp  = cmbChooseSort.Text;
            tmp2 = cmbChooseSort2.Text;
            DisableControls();

            BackgroundWorker sort  = new BackgroundWorker();
            BackgroundWorker sort2 = new BackgroundWorker();

            sort.DoWork  += new DoWorkEventHandler(Sorting);
            sort2.DoWork += new DoWorkEventHandler(Sorting2);

            sort.RunWorkerCompleted  += new RunWorkerCompletedEventHandler(EnableControls);
            sort2.RunWorkerCompleted += new RunWorkerCompletedEventHandler(EnableControls);

            sort.RunWorkerAsync();
            Thread.Sleep(10);
            sort2.RunWorkerAsync();
        }
        private void Draw(object sender, MouseEventArgs e)
        {
            try
            {
                NumberOfElements = Int32.Parse(txtbNumberOfElements.Text);
                test             = new CollectionOfElements(NumberOfElements, Bitmap, pctbox_drawingArea);
                test2            = new CollectionOfElements(NumberOfElements, Bitmap2, pctbox_drawingArea2);
            }
            catch
            {
                MessageBox.Show("Please set parameters", "No parameters");
                return;
            }


            if (pctbox_drawingArea.Image != null)
            {
                pctbox_drawingArea.Image.Dispose();
                pctbox_drawingArea.Image = null;
            }

            if (pctbox_drawingArea2.Image != null)
            {
                pctbox_drawingArea2.Image.Dispose();
                pctbox_drawingArea2.Image = null;
            }

            Bitmap  = new Bitmap(pctbox_drawingArea.Width, pctbox_drawingArea.Height);
            Bitmap2 = new Bitmap(pctbox_drawingArea2.Width, pctbox_drawingArea2.Height);

            ChooseFillType();

            test2.Initiate();
            test2.ColoneCoe(test);

            test.DrawElements();
            test2.DrawElements();
            btnSort.Enabled = true;
        }