>>well, the compiler fortunately didnt complain :-)
No, in fact thats unfortunate.
>>anyway, the advantage of this implementation over the next_permutation in STL is, that you can instantly get the permutation at any index.
The disadvantages is that this is not a safe code. Its a homemade code,
and is likely to fail at some point with some wrong input. Its not as
efficient as the stl...and much more to list.
Generally, one does this for practice, NOT to replace stl's algorithm.
firstPerson
Senior Poster
3,923 posts since Dec 2008
Reputation Points: 841
Solved Threads: 608