4 ms·
In addition to what has been said about lexicographic ordering, if the strings are large, say several kB (as they may well be), the entire operation would be do
by maggit 10y ago
In addition to what has been said about lexicographic ordering, if the strings are large, say several kB (as they may well be), the entire operation would be dominated by memory latency. In this case it is much cheaper to read each string once, instead of going an extra pass just to find the length.