Documentation
¶
Index ¶
- func CombinationsInt(iterable []int, r int) chan []int
- func CombinationsList(iterable List, r int) chan List
- func CombinationsStr(iterable []string, r int) chan []string
- func GenCombinations(n, r int) <-chan []int
- func GenPermutations(n int) <-chan []int
- func PermutationsInt(iterable []int, r int) chan []int
- func PermutationsList(iterable List, r int) chan List
- func PermutationsStr(iterable []string, r int) chan []string
- type List
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CombinationsInt ¶
CombinationsInt generates all the combinations of r elements extracted from an slice of integers
func CombinationsList ¶
CombinationsList generates all the combinations of r elements extracted from a List (an arbitrary list of elements). A List can be created for instance, as follows myList := List{"a", "b", 13, 3.523}
func CombinationsStr ¶
CombinationsStr generates all the combinations of r elements extracted from an slice of strings
func GenCombinations ¶
GenCombinations generates, from two natural numbers n > r, all the possible combinations of r indexes taken from 0 to n-1. For example if n=3 and r=2, the result will be: [0,1], [0,2] and [1,2]
func GenPermutations ¶
GenPermutations generates, given a number n, all the n factorial permutations of the integers from 0 to n-1
func PermutationsInt ¶
PermutationsInt generates all the permutations of r elements extracted from an slice of integers
func PermutationsList ¶
PermutationsList generates all the permutations of r elements extracted from a List (an arbitrary list of elements). A List can be created, for instance, as follows: myList := List{"a", "b", 13, 3.523}
func PermutationsStr ¶
PermutationsStr generates all the permutations of r elements extracted from an slice of strings