void permute(char *a, int l, int r)
{
int i;
if (l == r)
cout << "A" << a << endl;
else
{
for (i = l; i <= r; i++)
{
swap((a+l), (a+i));
permute(a, l+1, r);
swap((a+l), (a+i));
}
}
}
int main()
{
char str[] = "BCDEF";
int n = strlen(str);
permute(str, 0, n-1);
The answer to the question is available in the PDF file https://www.assignmentexpert.com/https://www.assignmentexpert.com/homework-answers/programming-answer-59477.pdf
Dear customer, Unfortunately, your question requires a lot of work and
cannot be done for free. Please submit it with all requirements as an
assignment to our control panel and we'll assist you.
Salem
27.04.16, 01:01
P(6,4)=360 that means we should get 360 different ways to list all the
letters "ABCDEF" were A appears before D. This code just prints 18
outputs !!
Leave a comment
Thank you! Your comments have been successfully added. However, they need to be checked by the moderator before being published.
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
"assignmentexpert.com" is professional group of people in Math subjects! They did assignments in very high level of mathematical modelling in the best quality. Thanks a lot
Comments
Dear customer, Unfortunately, your question requires a lot of work and cannot be done for free. Please submit it with all requirements as an assignment to our control panel and we'll assist you.
P(6,4)=360 that means we should get 360 different ways to list all the letters "ABCDEF" were A appears before D. This code just prints 18 outputs !!
Leave a comment