Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Combinations ¶
Combinations produces a sequence containing all n-length combinations of distinct elements from s.
If s is [1 2 3] and n is 2, this function will produce:
[1 2] [1 3] [2 3]
func CombinationsWithReplacement ¶
CombinationsWithReplacement produces a sequence containing all n-length combinations of possibly repeated elements from s.
If s is [1 2 3] and n is 2, this function will produce:
[1 1] [1 2] [1 3] [2 2] [2 3] [3 3]
func Permutations ¶
Permutations produces a sequence containing all permutations of s. It uses Heap's Algorithm. See https://en.wikipedia.org/wiki/Heap%27s_algorithm.
If s is [1 2 3], this function will produce:
[1 2 3] [2 1 3] [3 1 2] [1 3 2] [2 3 1] [3 2 1]
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.