Sean Kelly wrote:
== Quote from Walter Bright ([email protected])'s article
Bill Baxter wrote:
It seems to me that the built-in .sort uses a randomized algorithm
that leads to results that differ from run-to-run when there are
elements with identical keys.
No, it doesn't use random sorts. The source code is included, so this
should be easy to verify.

I don't know if it helps, but the built-in sort uses a similar algorithm
to the sort routine in tango.core.Array.  It picks a "median of 3" value
for the pivot.  As Walter said, I don't believe any randomness is involved.


Sean

I think Bill speaks about a stable sort. You can have an unstable sort algorithm without having explicity a random invocation. Note that he's saying "leads to results that differ from run-to-run when there are elements with identical keys".

Reply via email to