ordenar un vector
C
//de menor a mayor
void ordenar(int v[], int size){
int i, j, aux;
//ALGORITMO DE BURBUJA
for (i = 0; i < size - 1; i++){
for (j = i + 1; j < size; j++){
if(v[i] > v[j]){
aux = v[i];
v[i] = v[j];
v[j] = aux;
}
}
}
printf("\n");
for(int i = 0; i <= size - 1; i++){
printf("vector[%d]: %d\n", i, v[i]);
}
}
//de mayor a menor
void ordenar_mayor_menor(int *v, int tam){
int i, j, aux;
for(i = 1; i < tam; i++){
for(j = tam - 1; j >= i; j--){
if(v[j] > v[j-1]){
aux = v[j];
v[j] = v[j-1];
v[j-1] = aux;
}
}
}
}
Also in C:
- Title
- reset c array to zero
- Category
- C
- Title
- bubble sort time complexity
- Category
- C
- Title
- networkx remove attributes
- Category
- C
- Title
- primo
- Category
- C
- Title
- division recursiva
- Category
- C
- Title
- excel cell blank or zero
- Category
- C
- Title
- fibonacci in c
- Category
- C
- Title
- docker logs follow
- Category
- C
- Title
- generate all permutations of string
- Category
- C
- Title
- how to change the mapping from jkil to wasd in vim
- Category
- C
- Title
- Difference between ** and *
- Category
- C
- Title
- múltiplos entre dos numeros en c
- Category
- C
- Title
- simpy process return value
- Category
- C
- Title
- get_session` is not available when using TensorFlow 2.0.
- Category
- C
- Title
- char to int c
- Category
- C
- Title
- error: ‘cout’ was not declared in this scope
- Category
- C
- Title
- uint32_t extract first bits
- Category
- C
- Title
- powershell search big files
- Category
- C
- Title
- what is restrict keyword in c
- Category
- C
- Title
- version of libgcc
- Category
- C
- Title
- tmux how to kill all sessions
- Category
- C
- Title
- pass the pointer in C
- Category
- C
- Title
- c pause for 1 second
- Category
- C
- Title
- how to login to another user in powershell
- Category
- C
- Title
- how to download file in powershell
- Category
- C
- Title
- dani
- Category
- C
- Title
- vector aleatorio sin repetir
- Category
- C
- Title
- how to get random numbers in c
- Category
- C
- Title
- c check if char is number
- Category
- C
- Title
- hopw to check how many duplicates in an array c
- Category
- C
- Title
- struct in C
- Category
- C
- Title
- How to pass a struct value to a pthread in c?
- Category
- C
- Title
- long commands makes terminal lag after modifying PS1
- Category
- C
- Title
- append to list in c
- Category
- C
- Title
- Gemfile.lock`. It is likely that you need to grant write permissions for that path.
- Category
- C
- Title
- chat
- Category
- C
- Title
- how to only show tenths place in c
- Category
- C
- Title
- '&&' within '||'
- Category
- C
- Title
- kadane's algorithm
- Category
- C
- Title
- arduino digital input pins
- Category
- C
- Title
- program using if statement in c whether numnber is less eqaul to greater than 50
- Category
- C
- Title
- diagonales
- Category
- C
- Title
- fibonacci series using recursion
- Category
- C
- Title
- qtableview get selected row
- Category
- C
- Title
- check if string in string c
- Category
- C
- Title
- vue cdn
- Category
- C
- Title
- factorial of a given number in c
- Category
- C
- Title
- c matrix sintax
- Category
- C
- Title
- how to write function in c
- Category
- C
- Title
- write a program to ask the user 8 integer numbers. your program will then move all negative elements of your array to the end of the array without changing the order of positive elements and negative elements
- Category
- C
- Title
- last element from list javascript
- Category
- C
- Title
- c struct
- Category
- C
- Title
- \0 in c
- Category
- C
- Title
- 'keras.backend' is not a package
- Category
- C
- Title
- write in a file using c
- Category
- C
- Title
- what is size_t in c
- Category
- C
- Title
- slug urls django
- Category
- C
- Title
- how to put a char into a string c
- Category
- C
- Title
- read files in c
- Category
- C
- Title
- c get first n characters of string
- Category
- C
- Title
- how to feed a char array to function in C
- Category
- C
- Title
- coin row problem in linear time
- Category
- C
- Title
- how to remove button decoration
- Category
- C
- Title
- left me on read
- Category
- C
- Title
- isalpha c
- Category
- C
- Title
- how to use ? in c
- Category
- C
- Title
- iterate through map
- Category
- C
- Title
- install postgres on linux
- Category
- C
- Title
- div
- Category
- C
- Title
- how to print a file c
- Category
- C
- Title
- arduino define
- Category
- C
- Title
- code in c skipping over scanf
- Category
- C
- Title
- disable gnu++11 option
- Category
- C
- Title
- hentai clochette
- Category
- C
- Title
- how can i remove a specific item from an array
- Category
- C
- Title
- c concatenate strings
- Category
- C
- Title
- strtoul C
- Category
- C
- Title
- read a binary file c
- Category
- C
- Title
- how to ascii art in c
- Category
- C
- Title
- diferencia entre * y & en c
- Category
- C
- Title
- passing 'const char *' to parameter of type 'char *' discards qualifiers
- Category
- C
- Title
- if statement shorthand c
- Category
- C
- Title
- how to mutex lock in c
- Category
- C
- Title
- How to setup a line length marker in vim
- Category
- C
- Title
- atoi c
- Category
- C
- Title
- how to print in c
- Category
- C
- Title
- oop244
- Category
- C
- Title
- suma de n numeros recursiva
- Category
- C
- Title
- delete string function in c
- Category
- C
- Title
- c if int
- Category
- C
- Title
- docker images command
- Category
- C
- Title
- router solicitation and advertisement magic is used by
- Category
- C
- Title
- stack
- Category
- C
- Title
- c printf right pad with space
- Category
- C
- Title
- find string in all files powershell
- Category
- C
- Title
- ModuleNotFoundError: No module named 'easydict'
- Category
- C
- Title
- where is /dev/kvm
- Category
- C
- Title
- python web crawler
- Category
- C
- Title
- mediawiki upload size
- Category
- C
- Title
- declaring a volatile in c
- Category
- C