C++ program to set all permutations of string. In this program bug is there and request you to fix the bug. thank you
setvariation (string z) {set response;if (z.length()==0) {return response ;{for (int i = 0; i{string pause = z.subtr(0,i) + z.subtr(i+1);setsuffixes = variation(pause);for (string x : suffixes) {response.insert(z[i] + x);}}return response;}
set response;if (z.length()==0) {return response ;{for (int i = 0; i{string pause = z.subtr(0,i) + z.subtr(i+1);setsuffixes = variation(pause);for (string x : suffixes) {response.insert(z[i] + x);}}return response;}
if (z.length()==0) {
return response ;
{
for (int i = 0; i
string pause = z.subtr(0,i) + z.subtr(i+1);
setsuffixes = variation(pause);for (string x : suffixes) {response.insert(z[i] + x);}}return response;}
for (string x : suffixes) {
response.insert(z[i] + x);
}
return response;
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here