Re: Stable sorts for all columnar or table data



Using a stable sort algorithm would not have any effect on the size of
documents, but it would increase the program size slightly and make the
sort operation slightly slower. The difference would probably be
imperceptible though, unless the tables you were sorting were enormous.


Bob I <birelan@xxxxxxxxx> wrote:
Are you asking for more document bloating features?

The Blue Max wrote:

Microsoft has not implemented a stable sort algorithm, but should
implement such an algorithm for all application and system dialogs that
present data in tables with columns. It would also be useful as an
alternative for sorting user worksheets and word processing tables.

In a stable sort the result of any prior sorts are preserved within the
new sort groups. A stable sort is the equivalent of sorting on multiple keys
or columns, but without having to actually specify the multiple keys.

For example, let???s consider the file listing shown in the ???Open??? dialog
used to open a new file in Excel. The listing is columnar and can be sorted
in either ascending or descending order by Name, Size, Type, or Date Modified
by clicking on the column header or label. In the case of a stable sort, the
user would first sort by ???Date Modified??? (click on column heading) and then
by ???Name' (click on column heading). The resulting list would be sorted in
primary groups by ???Name??? (i.e., the last sorted column) and then sub-sorted
by ???Date Modified??? (i.e., the first column sorted).

This is a very clean, efficient way to perform a simple sort based on
multiple columns and should be implemented system-wide for any columnar table
that can be sorted, both in system dialogs and in columnar user data. This
technique was employed years ago by many savvy developers. Unfortunately,
the Microsoft sort algorithm, at least in system and application dialogs,
destroys the prior sort order in such a way that subgroup listings of the new
sort are randomly jumbled.

----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.

http://www.microsoft.com/office/community/en-us/default.mspx?mid=12e26a71-c8af-4943-b36e-3aab52d1968a&dg=microsoft.public.office.misc


--
Gary L. Smith
Columbus, Ohio
.



Relevant Pages

  • Simulate Stable sort Using custom IComparer
    ... You can create a custom IComparer that accepts an array of keys you want to sort by that mimics a stable sorts and will provide the same results. ... This will produce the same results as a stable sort using the default quicksort provided in .NET. ... Stable Sort Method - Where Can I Get One? ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: General Idea how to attack this problem.
    ... Two elements with the same sort key may differ in other respects. ... Wikipedia doesn't have an article on "Stable sort". ... (varnish, French, Polish, glaze, polish, American) ...
    (comp.programming)
  • Re: Sorting a table
    ... AFAIK this is what a stable sort is. ...  The first sort does not need to be stable but the second should. ... if you use a non-stable sort there are two valid ...
    (comp.lang.lisp)
  • Re: Sorting files -- different approaches, your opinion?
    ... If the sort is stable, the result is groups of the same type where the ... Using a stable sort means the resulting order depends on the user's history ... using the filename as the tie-breaker when you sort (on ... situation using the above where I'd want the first criterion to be anything ...
    (comp.programming)
  • Re: sort numeric lists
    ... a sort algorithm will NOT preserve the original order ... Often, sort routines ... > BB> offer an option that WILL preserve original order. ... and it is not extra work to have a stable sort, ...
    (comp.lang.perl.misc)