sort()

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

sort()

Ross Lippert-2

I keep forgetting and the doc's don't say.  Is octave's
sort function stable or not?  If not, should it be?



-r


Reply | Threaded
Open this post in threaded view
|

sort()

John W. Eaton-6
On 26-Oct-2000, Ross Lippert <[hidden email]> wrote:

| I keep forgetting and the doc's don't say.  Is octave's
| sort function stable or not?  If not, should it be?

According to the code (src/DLD-FUNCTIONS/sort.cc):

// This is algorithm 5.2.4L from Knuth, Volume 3.

which is supposed to be a stable sorting method (that's one of the
primary reasons I chose it to replace the previous method, which used
qsort).

jwe