Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created Aug 31, 2020
Embed
What would you like to do?
public static void ordenarPorSeleccion(int[] arreglo) {
for (int i = 0; i < arreglo.length - 1; i++) {
for (int j = i + 1; j < arreglo.length; j++) {
if (arreglo[i] > arreglo[j]) {
// ...intercambiarlos, es decir, mover el actual a la derecha y el de la derecha al actual
int temporal = arreglo[i];
arreglo[i] = arreglo[j];
arreglo[j] = temporal;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment