Sorting for Humans : Natural Sort Order

hi,

i tested a few of the above solutions and ended up writing my own, thinking a more concise and faster solution would be possible by employing a simple state machine to divide and conquer complexity and limit the number of tests. it beats other C/C++ i’ve tested by a factor of 2 to 5, depending on the nature of the input. see https://www.o-rho.com/naturalsort

Interesting reading.
As much as it may be “stupid users”, it very much is a problem I’m staring at right now

They want wards in numerical order based on only descriptions
Ward 1
Ward 2
Ward 9
Ward 10
COVID-19 HDU Ward 15
Ward 17

Yeah… this isn’t fun

1 Like