2018-08-26から1日間の記事一覧
let rec insert = (lst: list(int), n: int): list(int) => switch (lst) { | [] => [n] | [first, ...rest] => switch (first < n) { | true => [first, ...insert(rest, n)] | false => [n,...lst] }; }; let rec insSort = (lst: list(int)): list(int) =…