Issue 27925

Summary: Sorting algorithm is unstable
Product: Calc Reporter: antonbijl <antonbijl>
Component: codeAssignee: spreadsheet <spreadsheet>
Status: CLOSED DUPLICATE QA Contact: issues@sc <issues>
Severity: Trivial    
Priority: P3 CC: erikanderson3, issues
Version: OOo 1.1.1   
Target Milestone: ---   
Hardware: All   
OS: All   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---
Attachments:
Description Flags
Example of unstable sort algorithm when sorting only by column A none

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