4 ms·
as I mentioned in the parent comment I tried saving just the start of each line, and then during sorting scan from the start until '\n' character, but this turn
by afiodorov 6y ago
as I mentioned in the parent comment I tried saving just the start of each line, and then during sorting scan from the start until '\n' character, but this turned out to be much slower
- BubRoss 6y agoIf you save the break between each line, you wouldn't have to scan to the end of the line, you would just look at the next line break.
- afiodorov 6y agothis would work, but once I start sorting lines I'll need a copy of original line breaks array; so in the end I'd need 16 bytes per line anyway