printf("\n");
}
+int comparar(const void *d1, const void *d2)
+{
+ char *c1, *c2;
+
+ c1 = (char *)d1;
+ c2 = (char *)d2;
+
+ return (*c1) - (*c2);
+}
int *jacu_mtf(char *datos, int len)
{
printf("Z original = ");
print_z(z, size);
printf("SIZE = %d\n", size);
- z[0]='A';z[1]='B';z[2]='C';z[3]='D';z[4]='R';
+ /*z[0]='A';z[1]='B';z[2]='C';z[3]='D';z[4]='R';*/
+ /* Ordeno */
+ qsort(z, size, 1, comparar);
+ printf("Z ordenado = ");
+ print_z(z, size);
+
for(i=0; i<len; i++){
pos[i] = get_pos(z, size, datos[i]);
printf("vino %c emiti: %d\n",datos[i], pos[i]);