Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
quicksort guía 4
#include <stdio.h> #include <stdlib.h> int compareStrings( const void *, const void * ); typedef char cadena[26]; int main(void) { int N = 8; int i; cadena vector[8] = {"udec.cl", "upla.cl", "utfsm.cl", "hotmail.com", "gmail.com", "inf.pucv.cl", "gmail.com", "inf.pucv.cl"}; // Ordenamiento decreciente; qsort( vector, N, sizeof(cadena), compareStrings); for (i = 0 ; i < N ; i++) printf("%s\n", vector[i]); return 0; } // 'a' representa el pivote, y 'b' es el elemento con el cual se compara el pivote. int compareStrings( const void *a, const void *b ) { char *ptrA = (char *) a; char *ptrB = (char *) b; return strcmp(ptrA, ptrB); }
run
|
edit
|
history
|
help
0
Time Stamp
Simple interest
18BCE2182 ASSESS_1 Q2-1
C141105_SwitchNotas
test
B_141104_NotaSwitch
Test 2
Quadratic Formula
c. new one
SUDOKUS CORRECTOS