Stable sorts for all columnar or table data

T

The Blue Max

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/com...-3aab52d1968a&dg=microsoft.public.office.misc
 
G

Gary Smith

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.
 
T

Tony Jollans

Unless you have inside knowledge you really can't say what effect changing
either algorithms or mechanics would have. A design decision, if that is
what it was, was made and, had a different one been made, the resulting
product would have been different - not necessarily bigger or slower, just
different.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top