Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
método de ordenamiento insertion sort
#include <stdio.h> #include <stdlib.h> void insertionSort(int *, int); int main(void) { int vector[5] = { 90, 80, 70, 60, 50}; int N = 5; int i; // Ordenar de menor a mayor. insertionSort(vector, N); for (i = 0 ; i < N ; i++) printf("%d ", vector[i]); return 0; } void insertionSort(int *vector, int N) { int i; int j; int pivote; for ( i = 1 ; i < N ; i++) { pivote = vector[i]; j = i - 1; // Ciclo para el desplazamiento while ( (j >= 0) && (vector[j] > pivote) ) { vector[j + 1] = vector[j]; j --; } // Inserción. vector[j + 1] = pivote; } }
run
|
edit
|
history
|
help
0
% with negative numerator and positive denominator (gcc)
Ahora si?
Lab 9 v0.6
20171117_TARTAGLIA
Why &(a+1) is not allowed
Character testing
ForU
Multiple If statements v1
18BCE2182 ASSESS_1 Q1-9
pllkkj