writing function for permutation

  • Thread starter Thread starter dave
  • Start date Start date
D

dave

Hi There
Can anyone help to write permutation function for following formula..
nPr = n!/(n-r)!
where n is length of given string and r is lengh of subset..
for example..if given string is "abcd" and r = 2 then out put shuld be
ab
ac
ad
ba
bc
bd..and so on...

and if r = 3 then output shuld be
abc
abd
acb
acd and so on...

Any help would be highly appreciated..
thnx
dave
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Permut 4
Pattern / Combinations 6
List of Permutations 1
Combinations & Permutations 3
Combination Algorithm 1
HTTP POST + Webrequest 0
Countif layering 2
Pairs, Triplets, Quads... 10

Back
Top