Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created May 16, 2020 06:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/6c05f6aab874c7da617bf2ab84730f60 to your computer and use it in GitHub Desktop.
Save parzibyte/6c05f6aab874c7da617bf2ab84730f60 to your computer and use it in GitHub Desktop.
void seleccion(int arreglo[], int longitud) {
for (int i = 0; i < longitud - 1; i++) {
for (int j = i + 1; j < longitud; j++) {
if (arreglo[i] > arreglo[j]) {
// ...intercambiarlos, es decir, mover el actual a la derecha y el de la derecha al actual
intercambiar(&arreglo[i], &arreglo[j]);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment