1 votes 1 votes Write a $C$ program to fins all permutations of a string (having at most 6 characters). For example, a string of $3$ characters like $“abc"$ has 6 possible permutations: $“abc", “acb", “bca", “bac", “cab", “cba".$ Programming in C isi2017-pcb-cs programming programming-in-c descriptive + – akash.dinkar12 asked Apr 8, 2019 akash.dinkar12 505 views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes we can solve it using backtracking string s; int permutation(int i , int n){ if(i==n-1) cout<<s; else{ for(int j=i;j<n;j++){ swap(s[j], s[i]); permutation(i+1 , n); swap(s[j] ,s[i]); } } } satya753 answered Sep 1, 2019 satya753 comment Share Follow See all 0 reply Please log in or register to add a comment.