octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: stable sorts


From: Ed Meyer
Subject: Re: stable sorts
Date: Sat, 25 Aug 2012 21:07:51 -0700



On Sat, Aug 25, 2012 at 7:40 PM, Michael D Godfrey <address@hidden> wrote:
On 08/25/2012 09:55 PM, Ed Meyer wrote:
Just because it has kept the order of x(2) and x(3) does not necessarily mean it is a stable sort;
an unstable sort can do either but a stable sort is guaranteed to keep the original order.

--
Ed Meyer
Yes.  But, this thread started from an error on my part.  I had thought
that Ben's fix for interp1 was based on the Octave sort not being stable.
The real problem was with the direction of the discontinuity mechanism
in interp1.

I am pretty sure that Octave sort is stable, but this could be checked
more, of course.

Michael


Comments in the code indicate it is a stable search;  the function is
called binarysort but I've never heard of a binary sort so I'm not sure
what it's doing :-(
I think I'll run a bunch of tests to see if it ever does an unstable sort.

--
Ed Meyer


reply via email to

[Prev in Thread] Current Thread [Next in Thread]