Visual c·#
private void button1_Click(object sender, EventArgs e)
{
int contador = 0;
// codigo de boton
StreamReader Archivo=new StreamReader("E:\Archivo.txt");
// Leer linea de texto="";
string texto="";
while (Archivo.Peek() != -1)
{
string Leer = Archivo.ReadLine();if (String.IsNullOrEmpty(Leer))
continue;
texto += Leer;
listBox1.Items.Add(Leer);
aux[contador] = Leer;contador++;
}
}
private void button1_Click_1(object sender, EventArgs e)
{
for(int i=0;i x2[0])
{string temp = aux[j];
aux[j] = aux[j + 1];
aux[j + 1] = temp;
}
}
for (int i = 0; i
}
}
}
METODOS
private void Ordenar_Click(object sender,EventArgs e)
{
for (i = 0; i < ciclo; i++)
{
k = i;
for (j = i + 1; j < ciclo; j++)
if (aux[j] < aux[k]){
k = j;
}
temp = aux[k];
aux[k] = aux[i];
aux[i] = temp;
}for (i = 0; i < ciclo; i++)
listBox1.Items.Add(aux[i].ToString());
}
private void Burbuja_Click(object sender, EventArgs e)
{for (i = 0; i < (n - 1); i++)
for (j = 0; j < (n - 1); j++)
if (aux[i] > aux[i + 1])
{
temp =...
Regístrate para leer el documento completo.