![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Search Algorithm
o0Helloworld0o
怕是要翻水水哦
展开
-
排列组合
全排列 #include <stdio.h> #include <algorithm> #define MAXN 50 using namespace std; int n; int nums[MAXN + 10]; void dfs( int k ) { if( k == n ) { for( int i = 0; i <...原创 2018-08-07 15:30:47 · 151 阅读 · 0 评论 -
Permutations
简单版本:数组中不包含重复元素 46. Permutations 困难版本:数组中包含重复元素 47. Permutations II class Solution { public: // 借用了31. Next Permutation的代码,能够避免去重的麻烦 vector<vector<int>> permuteUnique(vector&lt...原创 2018-08-07 16:38:36 · 159 阅读 · 0 评论 -
Combination Sum / Subset
39. Combination Sum(AC代码) 给定数组candidates,不含重复元素,求一个组合(允许重复使用),使得和为target 78. Subsets(AC代码) 40. Combination Sum II(AC代码) 90. Subsets II(AC代码) 216. Combination Sum III(AC代码)...原创 2018-08-07 20:50:18 · 131 阅读 · 0 评论