private void Graficuzin(int numero) { chart1.Series["Series1"].Points.Clear(); for (int i = 0; i <= numero; i++) { lista.Primeiro = null; for (Int32 j = 0; j < (i + 1) * 5; j++) { Elemento elemento = new Elemento(r.Next(1, 100)); lista.Adiciona(elemento); arr.Add(elemento); } Stopwatch stope = new Stopwatch(); stope.Start(); BubbleSort(arr); stope.Stop(); chart1.Series["Series1"].Points.AddXY((i + 1) * 5, stope.Elapsed.TotalSeconds); } }
private void InicializarLista(object sender, EventArgs e) { Elemento elemento = new Elemento(lista.Count); lista.Adiciona(elemento); }
public Elemento(int v, Elemento p = null, Elemento a = null) { Valor = v; Proximo = p; Anterior = a; }