Friday, July 31, 2009

What function in c programming to display output as kav,vak,avk,kva,vka,akv where input is kav?

Something like this, I guess?


f(char *i){ g(i,i);}





g(char *o,char *i)


{


char c,*x;


if (!*i) {printf("%s,",o);return;}


for (x=i; *x; x++){ c=*i;*i=*x;*x=c; g(o,i+1); *x=*i;*i=c; }


}

What function in c programming to display output as kav,vak,avk,kva,vka,akv where input is kav?
AFAIK, standard C libraries do not contain permutation functions. You need to write it yourself. If you are looking for ready stuff, try to search statistics libraries at, say,


http://www.mathtools.net/
Reply:there is no such inbuilt function. you have to create it on ur own. if u want it mail me at john_r225@yahoo.com


No comments:

Post a Comment