fn insertion(comptime T: type, items: []T, context: anytype, comptime lessThanFn: fn (@TypeOf(context), T, T) bool) void

Stable in-place sort. O(n) best case, O(pow(n, 2)) worst case. O(1) memory (no allocator required). Sorts in ascending order with respect to the given lessThan function.

Parameters

T: type,
items: []T,
context: anytype,
lessThanFn: fn (@TypeOf(context), T, T) bool,