Page 1 of 1

More Permutations

Posted: Sun Sep 14, 2003 2:18 am
by bugzpodder
Suppose we have a string of length n, and we want permutations of length k. how exactly do you do it? can anyone provide with an algorithm (or a name)?

thanks

Posted: Sun Sep 14, 2003 4:42 am
by anupam

using dfs. or bfs

Posted: Sun Sep 14, 2003 5:26 am
by bugzpodder
hi anupam,

such a recursive process guarentees that i can generate every permutation of length k using a set of n characters (not necessarly distinct), but what if i want the i-th permutation? is there a simple method to calculate without generating the first i permutations?

Posted: Sun Sep 14, 2003 9:09 am
by abductor
Hey bugz!

try to solve problem number 10460
maybe it will give you some ideas