Convex hull: Difference between revisions
Content added Content deleted
Line 2,458: | Line 2,458: | ||
# |
# |
||
# A merge sort implementation. |
# A merge sort implementation. This returns a sorted copy, leaving the |
||
# |
# original unchanged. |
||
# then only the sublist l[pos1:pos2] is sorted, and that sublist is |
|||
# returned. |
|||
# |
# |
||
# :Parameters : |
# :Parameters : |
||
# : `l` - the list to sort |
# : `l` - the list to sort |
||
# : `cmp` - a comparator function |
# : `cmp` - a comparator function |
||
# : `pos1` - the first slice index, default 1 |
|||
# : `pos2` - the second slice index, default 0 |
|||
# |
# |
||
procedure mergesort (l, cmp) |
procedure mergesort (l, cmp) |