Re: how to print all the combinations ??



Maciej Pilichowski wrote:
On 27 Mar 2006 22:29:20 -0800, "sudharsan" <suderson.tk@xxxxxxxxx>
wrote:

for a given set of numbers how to print all sort of combinations
for example if a[]={1,2,3};
need to print :- 123,132,213,231,312,321

So you need to print all the _permutations_. Now, when you know what
you are looking for use google.


Some languages can do this very easily, for example, C++ has the standard library function next_permutation. Otherwise you'll need to develop an equivalent function on your own.
.