Am 11.04.2019 um 12:58 schrieb Riccardo (Jack) Lucchetti:
As far as I know, we don't have a function for sorting string
arrays,
so I implemented quicksort in hansl as shown below.
As you can see, the function sorts the array and returns a vector of
integers so that you can map the old positions to the new ones if
needed. Performance is not at all bad, I'd say.
What about an approach that represents the strings in a numeric fashion
and then leverages the native msortby() function to get the ordering?
I'm thinking: would it be worthwhile to add this to the "extra" package?
What's the use case, by the way?
Speaking about arrays and the extra package: I don't want to hijack your
thread, but I've thought that a function would be useful that takes an
array argument and applies some operation (another function)
automatically to all elements of the array.
cheers
sven