I am getting output in reverse order. Please help me in getting output in correct order https://ide.codingblocks.com/s/174557
Recursion subsequence
Instead of using char array, use string and change your function as,
void printsubsequences(string str,string osf)
{
if(str.length()==0)
{
cout<<osf<<" ";
return;
}
char ch=str[0];
string ros=str.substr(1);
printsubsequences(ros,osf);
printsubsequences(ros,osf+ch);
}
Where your str will be input string and osf would be Null string…
Please explain logic of this code and tick is not showing on problem as I passed all test cases
I have already explained you the logic over the chat… also since the website is under some changes… You can wait for few days… If the issue still persist, you can drop the mail at [email protected]