[ENH] StableSortedCollection, was RE: Sorting oddity - feature or ??

Jarvis, Robert P. (Contingent) Jarvisb at timken.com
Wed May 1 19:41:47 UTC 2002


> From: Jon Hylands [mailto:jon at huv.com]
> 
> I haven't checked Squeak, but I assume it uses some 
> variation of Quicksort.

Attached is a change set that implements a subclass of SortedCollection that
uses a combination of merge-sort and insertion-sort.  It's slower than
SortedCollection in the 'fast' case, but much faster in the 'slow' case.
And to the best of my knowledge the sort is stable, which sometimes proves
useful.

Bob Jarvis
Compuware @ Timken



**********************************************************************
This message and any attachments are intended for the 
individual or entity named above. If you are not the intended
recipient, please do not forward, copy, print, use or disclose this 
communication to others; also please notify the sender by 
replying to this message, and then delete it from your system. 

The Timken Company
**********************************************************************
-------------- next part --------------
A non-text attachment was scrubbed...
Name: StableSortedCollection-rpj.1.cs
Type: application/octet-stream
Size: 2375 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20020501/47762c8b/StableSortedCollection-rpj.1.obj


More information about the Squeak-dev mailing list