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; }
private void BubleSort() { hi1 = DateTime.Now; b = new BubleSort(v1, v1.Count()); hf1 = DateTime.Now; this.Invoke((MethodInvoker) delegate { lbtemp1.Text = "Tempo:" + "\n" + (hf1 - hi1).ToString(); }); c4 = true; }