Content deleted Content added
I intend to move equijoin and set differences form Merge_algorithm to Sorted_list_algorithms |
Minor change to python example |
||
Line 23:
[[User:Pablo.cl|Pablo.cl]] 01:50, 26 May 2004 (UTC)
== Minor change to python example ==
The example originally had a[0] < b[0] rather then a[0] <= b[0]
as the basis for using the item from the a[] array. This would
not result in a stable sort, since equal elements would have been
selected from the b[] array before those from the a[] array.
The change ensures stability.
It's a bit of a shame that one sees so many assertions that
merge sort is stable. As the uncorrected example shows,
it's easily possible to write an unstable, but otherwise
valid, merge sort. -- jpl
|