Documentos de Académico
Documentos de Profesional
Documentos de Cultura
INDOAMÉRICA
TEMA:
Integrante:
ANTHONY ARTEAGA
Docente:
Ambato – 2019
SE DESEAN ORDENARSE LAS SIGUIENTES CLAVE DEL ARREGLO A: 15, 67, 08, 16, 44, 27, 12, 35, 56,
21, 13, 28, 60, 36, 07, 10, UTILIZANDO SHELL
Código fuente
/*
* A: 15, 67, 08, 16, 44, 27, 12, 35, 56, 21, 13, 28, 60, 36, 07, 10,
* UTILIZANDO SHELL
*/
package ec.edu.uti.deber;
/**
* @author anthony
*/
int arreglo[]={15, 67, 8, 16, 44, 27, 12, 35, 56, 21, 13, 28, 60, 36, 7, 10};
shellSort(arreglo);
for( int gap = a.length / 2; gap > 0; gap = gap == 2 ? 1 : (int) ( gap / 2.2 ) ){
int tmp = a[ i ];
int j;
a[ j ] = a[ j - gap ];
a[ j ] = tmp;
System.out.println(a[i]);
Capturas de pantalla