[algogeeks] Re: permuting the elements of an array

2009-08-19 Thread sandy
Please see http://geeksforgeeks.org/?p=767 for well explained C implementation of the same. On Jun 23, 10:01 am, Ajinkya Kale kaleajin...@gmail.com wrote: Yeah c++ STL nextpermutation api will do it .. good solution Miroslav! On Tue, Jun 23, 2009 at 10:25 PM, Miroslav Balaz

[algogeeks] Re: permuting the elements of an array

2009-06-23 Thread Miroslav Balaz
It is also so easy, but maybe requires more lines of code you only need count number of used number for each 1..n and then...(repeat recursive approach) ONE LINE SOLUTION IN C++ ok use next permutation from STL, read how it works for other language and initialize array 11223344, and do while

[algogeeks] Re: permuting the elements of an array

2009-06-23 Thread Ajinkya Kale
Yeah c++ STL nextpermutation api will do it .. good solution Miroslav! On Tue, Jun 23, 2009 at 10:25 PM, Miroslav Balaz gpsla...@googlemail.comwrote: It is also so easy, but maybe requires more lines of code you only need count number of used number for each 1..n and then...(repeat recursive