## 标题字符串的排列
1.题目 :输入一个字符串,按字典序打印出该字符串中字符的所有排列。例如输入字符串abc,则打印出由字符a,b,c所能排列出来的所有字符串abc,acb,bac,bca,cab和cba。
2.解题思路:

3.程序实现:
class Solution {
public:
vector<string> Permutation(string str) {
vector<string> vec_res;
int len=str.length();
if(len==0)
return vec_res;
permutations(vec_res,str,0,len);
return vec_res;
}
void permutations(vector<string>& vec_res,string str,int index,int len)
{
if(index==len)
{
vec_res.push_back(str);
return;
}
for(int i=index;i<len;i++)
{
if(i!=index && str[i]==str[index]) //去除重复数字的影响
continue;
swap(str[i],str[index]);
permutations(vec_res,str,index+1,len);
}
}
};