Documentation ¶
Index ¶
- func Abs(n int) int
- func AbsInt32(a int32) int32
- func AbsInt64(a int64) int64
- func Combination(n, m int) (combs [][]int)
- func Even(m int) bool
- func MaxInt(a, b int) int
- func MaxInt32(a, b int32) int32
- func MaxInt64(a, b int64) int64
- func MinInt(a, b int) int
- func MinInt32(a, b int32) int32
- func MinInt64(a, b int64) int64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Combination ¶
Combination 从src中选取length个元素出来 组合是一个基本的数学问题,本程序的目标是输出从n个元素中取m个的所有组合。 例如从[1,2,3]中取出2个数,一共有3中组合:[1,2],[1,3],[2,3]。(组合不考虑顺序,即[1,2]和[2,1]属同一个组合) 从n中选取m个组合 例如: 从make([]int, 10)中选取5个元素的所有组合,此时n=10, m=5 返回的combination为为每个元素的索引组成的二维切片
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.