Documentation
¶
Index ¶
- func Merge[A cmp.Ordered](all [][]A) []A
- func MergeFunc[A any](all [][]A, cmp func(a, b A) int) []A
- func MergeFuncLimit[A any](all [][]A, cmp func(a, b A) int, limit int) []A
- func MergeFuncLimitNoEmptyLists[A any](all [][]A, cmp func(a, b A) int, limit int) []A
- func MergeFuncNoEmptyListsIntoSlice[A any](res []A, all [][]A, cmp func(a, b A) int) []A
- func MergeLimit[A cmp.Ordered](all [][]A, limit int) []A
- func MergeLimitNoEmptyLists[A cmp.Ordered](all [][]A, limit int) []A
- func MergeNoEmptyListsIntoSlice[A cmp.Ordered](res []A, all [][]A) []A
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Merge ¶
Merge take a bunch of simple lists and merges them. They must be ordered otherwise everything will be broken. Merge will order stuff with bigger values first, which is the opposite of what everybody else does. Why? Because that how I needed it to work. It will also expect the given lists to be ordered like that.
func MergeFunc ¶ added in v0.0.3
MergeFunc is like Merge, but takes a custom comparator. It will still put bigger elements first (but you can pass a comparator that returns reverse values if you want the opposite behavior).
func MergeFuncLimit ¶ added in v0.0.4
MergeFuncLimit is like MergeLimit, but with a custom comparator.
func MergeFuncLimitNoEmptyLists ¶ added in v0.0.6
MergeFuncLimitNoEmptyLists is like MergeLimitNoEmptyLists, but with a custom comparator.
func MergeFuncNoEmptyListsIntoSlice ¶ added in v0.0.7
MergeFuncNoEmptyListsIntoSlice is like MergeNoEmptyListsIntoSlice, but with a custom comparator.
func MergeLimit ¶ added in v0.0.4
MergeLimit is the same as Merge, but takes a limit. While Merge will order all the items in all the lists MergeLimit will stop when it reaches limit, which means it will be much faster if the limit is smaller than the total count of all items.
func MergeLimitNoEmptyLists ¶ added in v0.0.6
MergeLimitNoEmptyLists is the same as MergeLimit, but assumes there are not empty lists, like MergeNoEmptyLists.
func MergeNoEmptyListsIntoSlice ¶ added in v0.0.7
MergeNoEmptyListsIntoSlice is the same as MergeLimitNoEmptyLists, but take a slice into which it will insert the results. The slice length will not be increased, its length will be treated as the max limit.
Types ¶
This section is empty.