private void btordena_Click(object sender, EventArgs e)
        {
            if (op == "BubleSort")
            {
                M            = new BubleSort(v, v.Count());
                vet          = M.vetorordenado();
                lbvetor.Text = vet;
            }
            if (op == "SelectSort")
            {
                S            = new SelectSort(v, v.Count());
                vet          = S.vetorordenado();
                lbvetor.Text = vet;
            }
            if (op == "ShellSort")
            {
                SS           = new ShellSort(v, v.Count());
                vet          = SS.vetorordenado();
                lbvetor.Text = vet;
            }
            if (op == "QuickSort")
            {
                Q = new QuickSort();
                int[] ve = Q.quickSort(v, 0, v.Count() - 1);
                for (int z = 0; z < ve.Count(); z++)
                {
                    vet += ve[z] + " ";
                }
                lbvetor.Text = vet;
            }

            btgrava.Visible = true;

            pnordena.Enabled = true;
        }
예제 #2
0
 private void ShellSort()
 {
     hi1 = DateTime.Now;
     s   = new ShellSort(v1, v1.Count());
     hf1 = DateTime.Now;
     this.Invoke((MethodInvoker) delegate
     {
         lbtemp4.Text = "Tempo:" + "\n" + (hf1 - hi1).ToString();
     });
     c3 = true;
 }