char *z, *dato;
char *pos;
int len;
- int i, size;
+ int i, size, z_len;
len = fread(buff, 1, BUFFER_SIZE, stdin);
buff[len] = '\0';
- pos = jacu_mtf(buff, len);
+ pos = jacu_mtf(buff, len, &z, &z_len);
for(i=0; i<len; i++)
printf("%d ",pos[i]);/*putchar(pos[i]);*/
return 0;
}
-
pos = (char *)malloc(len*sizeof(char));
z = jacu_buscar_z(datos, len, &size);
- (*_z) = jacu_buscar_z(datos, len, &size);
-
+ *_z = (char*)malloc(len*sizeof(char));
+ memcpy(*_z, z, len*sizeof(char));
for(i=0; i<len; i++){
pos[i] = get_pos(z, size, datos[i]);
- printf("pos de %c = %d\n", datos[i], pos[i]);
if (pos[i] != 0)
pop_front(z, pos[i]);
}
-
- /*(*_z) = z;*/
(*z_len) = size;
return pos;
}