3 ms·
How hard is it to get right, seriously? I mean you just check a bunch of edge cases. Recursion is not even necessary!
by EGreg 9y ago
How hard is it to get right, seriously?
I mean you just check a bunch of edge cases. Recursion is not even necessary!
- TheOtherHobbes 9y agoIf you're just sorting ASCII English it's pretty trivial, as long as you assume ASCII ordering throughout. But for all possible data types, in all (okay - most) written languages, with full unicode support, dealing successfully with all possible localised edge cases defining postal/delivery address and date/time formats - very hard indeed.
- EGreg 9y agoWell that's up to the writer of that class to implement a comparator function to define a total order correctly. I am not even sure there an be a meaningful total order on postal addresses. The binary sort algorithm shouldn't care about how that's implemented. Separation of concerns baby :)