diff --git a/fonte/U4 - Ordenação em memória principal/c/selecao.h b/fonte/U4 - Ordenação em memória principal/c/selecao.h index 7fa7d68..8a8bfce 100644 --- a/fonte/U4 - Ordenação em memória principal/c/selecao.h +++ b/fonte/U4 - Ordenação em memória principal/c/selecao.h @@ -4,16 +4,16 @@ #include "geracao.h" //============================================================================= void selecao(int *array, int n){ - int i, j, indice; + int i, j, menor; for (i = 0; i < (n - 1); i++) { - indice = i; + menor = i; for (j = (i + 1); j < n; j++){ - if (array[indice] > array[j]){ - indice = j; + if (array[menor] > array[j]){ + menor = j; } } - swap(&array[indice], &array[i]); + swap(&array[menor], &array[i]); } } //============================================================================= -#endif \ No newline at end of file +#endif