代码拉取完成,页面将自动刷新
package intf
import (
"gitee.com/ljfirst/algo-go-sdk/src/algorithm/backtrack"
"gitee.com/ljfirst/algo-go-sdk/src/algorithm/dynamic"
"gitee.com/ljfirst/algo-go-sdk/src/data_structure/array/permute_combine"
"gitee.com/ljfirst/algo-go-sdk/src/data_structure/array/two_point"
)
/**
* @author ljfirst
* @version V1.0
* @date 2023/7/7 13:29
* @author-Email ljfirst@mail.ustc.edu.cn
* @blogURL https://blog.csdn.net/ljfirst
* @description 排列组合
* */
type PermuteINTF interface {
PermuteMethod(arrayI interface{}) [][]interface{}
}
type CombineINTF interface {
//PermuteMethod(arrayI interface{}) [][]interface{}
}
var PermuteAndCombineAssemble = []interface{}{
&permute_combine.Permutation{},
&permute_combine.PermutationByChange{},
&permute_combine.PermutationWithRepeatNum{},
&permute_combine.PermutationWithRepeatNumReduce{},
&permute_combine.PermutationTime{},
// 从数组中选取 2个数,使得和等于 target,可以参考双指针解法:
&two_point.TwoSum{},
// 或者map去重法:
&two_point.TwoSumByMap{},
// 如果不限制只选取 2个数,并且数组元素 可以 无限重复的选择 (有回溯和动态规划两种做法,回溯可以获取到元素值,动态规划只局限于结果)
&backtrack.CombinationRepeatNum_BackTrack{},
// ,如果数组元素 不可以 无限重复的选择 (演变成背包问题)
&dynamic.CombinationNum_Dynamic{},
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。