//Metodo de Ordenacion SHELL
private void button5_Click(object sender, EventArgs e)
{
int i, j, inc, temp;
int n = 10;
for (inc = 1; inc < n; inc = (inc * 3) + 1) ;
while (inc > 0)
{
for (i = inc; i < n; i++)
{
j = i;
temp = A[i];
while ((j >= inc) && (A[j - inc] > temp))
{
A[j] = A[j - inc];
j = j - inc;
}
A[j] = temp;
}
inc /= 2;
}
}
No hay comentarios:
Publicar un comentario