4 ms·
this is pretty bad code. For the C version, just changing strcat(gstr, str); to strcat(&gstr[lngth - str_len], str); cuts the execution time by 1/4 for the
by erobbins 13y ago
this is pretty bad code.
For the C version, just changing
strcat(gstr, str);
to
strcat(&gstr[lngth - str_len], str); cuts the execution time by 1/4 for the longest cases.
original: 471sec 4096kb
changed: 356sec 4096kb