comparison_sort: Sort a List of Objects By Comparison

Description Usage Arguments

Description

merge_sort uses a merge sorting algorithm to produce a sorted list from the input given a pairwise comparison function.

insertion_sort uses a merge sorting algorithm to produce a sorted list given a pairwise comparison function.

Usage

1
2
3
4
merge_sort(v, lt = `<`, bail_depth = 50, bail_size = 20,
  bail_func = insertion_sort)

insertion_sort(v, lt = `<`)

Arguments

v

list of objects to sort.

lt

function accepting two arguments and returning a logical – whether the first argument is less than the second (e.g.


cosmicexplorer/comparisort documentation built on May 24, 2019, 2:48 p.m.