Permutation

Colin Campbell [DCS] campbell at watdcsu.waterloo.edu
Fri Sep 15 00:40:17 AEST 1989


In article <16385 at watdragon.waterloo.edu> leung at gwchem.waterloo.edu (K.W. Leung) writes:
>Does anyone out there have a C program which can generate all distinct
>permutations of n symbol? I need this to generate some graphs. 
>
>Thanks in advance.
>					Kamiwuni

You might be interested to know of Maple's permute function, e.g.:
     permute([a,b,c]);
            [[a,b,c], [a,c,b], [b,a,c], [b,c,a], [c,a,b], [c,b,a]]
or:
     permute(3);
            [[1,2,3], [1,3,2], ...]
or:
     permute(3,2);
            [[1,2], [1,3], [2,1], [2,3], [3,1], [3,2]]



More information about the Comp.unix mailing list