Re: [Algorithms] Generating the ith permutation of N elements
Brought to you by:
vexxed72
From: Yannick L. <yan...@ub...> - 2010-06-01 19:34:15
|
Yes any consistent order will do. Yannick From: Danny Kodicek [mailto:dr...@we...] Sent: 1 juin 2010 14:48 To: Game Development Algorithms Subject: Re: [Algorithms] Generating the ith permutation of N elements I'm looking for a way to generate the ith permutation of N elements, at approximately O(N) cost. All algorithms I've seen need the (i-1)th permutation in order to derive the ith permutation from it (e.g. they work incrementally).# As far as I know there isn't a standard order for permutations and so there isn't such a thing as 'the' i'th permutation. Am I wrong? Or are you just looking for a consistent order rather than a standard one? Danny |