
![]() |
Show Changes |
![]() |
Edit |
![]() |
|
![]() |
Recent Changes |
![]() |
Subscriptions |
![]() |
Lost and Found |
![]() |
Find References |
![]() |
Rename |
![]() |
Administration Page |
| Search |
History
| 3/1/2006 6:50:39 PM |
| -68.15.147.130 |
![]() |
List all versions |
A StableSort preserves the order of records which have equal keys. For example, given the following unsorted records:
| Sort Key | Value |
| Q | 1 |
| B | 3 |
| Y | 2 |
| Y | 1 |
| D | 1 |
| B | 2 |
| B | 1 |
| R | 1 |
A stable sort will result in the following:
| Sort Key | Value |
| B | 3 |
| B | 2 |
| B | 1 |
| D | 1 |
| Q | 1 |
| R | 1 |
| Y | 2 |
| Y | 1 |
Notice the the records with duplicate keys, the "B" records and "Y" records, stay in the same relative order: B3, B2, B1 and Y2, Y1. This is stability. If the order of the "B" or "Y" records were to change, say to B2, B1, B3 and Y1, Y2, then the sort would be unstable.
Currently, FlexWiki's sort is unstable.
-- ScottAinsworth [2006-03-01]