Re: Natural sort comparison
- Posted by _tom (admin) Jul 21, 2017
- 2083 views
petelomax said...
Am I right in thinking that the existing sort is perfectly stable - what is not stable is custom_sort, because you don't get any indexes with which to resolve ties.
"custom_sort" happens to lack an option for choice of columns
If you have just one column then all sorting algorithms give you the same answer. If items get swapped or not, you can not tell. Stability does not matter.
When you have two (or more columns) and you sort using a column a the key, then you can tell the difference. Stable sorting becomes important.
Using Andy's natural sort order: I got the same result with Mike_sort and std/sort.e; the items have no columns but have an "internal" order.
_tom