Convex hull: Difference between revisions

Content added Content deleted
Line 2,458: Line 2,458:
#
#


# A merge sort implementation. Unlike `qsort`, this returns a sorted
# A merge sort implementation. This returns a sorted copy, leaving the
# copy, leaving the original unchanged. If pos1 and pos2 are given,
# 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)