Miller, Raul D wrote:
> Here's another (more simplistic) approach:
>
>    perm=: [: ((#~ (0: < <./"1)) ~."1)&.:>: # #: [EMAIL PROTECTED]

Thank you for suggestion,

permc=: ([: ,/ [EMAIL PROTECTED] {"2 1 comb) f.
permd=: [: ((#~ (0: < <./"1)) ~."1)&.:>: # #: [EMAIL PROTECTED]

I ran some benchmark , it seems your method is both
slower and need more space.

      9!:14''
j504/2005-03-30/13:35

      2 ts '5 permd 10'
0.520293361 14151104
      2 ts '5 permc 10'
0.0106847379 2098240
      0.520293361 14151104 % 0.0106847379 2098240
48.6950046 6.7442733


----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to