Issue 27925 - Sorting algorithm is unstable
Summary: Sorting algorithm is unstable
Status: CLOSED DUPLICATE of issue 20491
Alias: None
Product: Calc
Classification: Application
Component: code (show other issues)
Version: OOo 1.1.1
Hardware: All All
: P3 Trivial (vote)
Target Milestone: ---
Assignee: spreadsheet
QA Contact: issues@sc
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-04-17 19:07 UTC by antonbijl
Modified: 2007-10-10 18:32 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Example of unstable sort algorithm when sorting only by column A (5.07 KB, application/vnd.sun.xml.calc)
2004-04-17 19:08 UTC, antonbijl
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description antonbijl 2004-04-17 19:07:06 UTC
The sorting algorithm seems to be unstable. To recreate open a spreadsheet and 
type values in two columns similar to below
A	100
B	100
C	90
A	90
A	110
D	100
A	80
Now select both columns and go Data - Sort
Select Column A and ascending as the one and only sort criteria and click OK.
The values are now sorted according to column A as expected, but in an unstable 
manner, since the values in column B for entries with equal values in column A 
are re-arranged. The actual result is:
A	90
A	110
A	80
A	100
B	100
C	90
D	100

The expected result of a stable sorting algorithm would be the following:
A	100
A	90
A	110
A	80
B	100
C	90
D	100

For more info, refer to this thread on the forums: 
http://www.oooforum.org/forum/viewtopic.php?t=7792
Comment 1 antonbijl 2004-04-17 19:08:07 UTC
Created attachment 14577 [details]
Example of unstable sort algorithm when sorting only by column A
Comment 2 frank 2004-04-19 10:25:32 UTC
Hi,

this is a double to Issue 20491.

And yes, I'm sure it's a double even if the description of this Issue is not as
good as it should be.

Frank

*** This issue has been marked as a duplicate of 20491 ***
Comment 3 frank 2004-04-19 10:25:49 UTC
closed double
Comment 4 alan_silva 2007-10-10 18:32:29 UTC
Its duplicate with 20491 and 22884