leetcode46——Permutations

題目大意:列出所給數字的全排列 分析:回溯法。這種枚舉所有組合情況的題,首先考慮回溯。 代碼: 方法一:逐步將數字添加到tmp中間集裏。當tmp裏面夠個數了就將中間集加入結果集中。class Solution { public:     vector<vector<int>> ans;     vector<int> tmp;     vector<vector<int>> permute(vec
相關文章
相關標籤/搜索