Permutatation algorithm without recursion? Java

Posted by Andreas Hornig on Stack Overflow See other posts from Stack Overflow or by Andreas Hornig
Published on 2010-05-09T20:35:18Z Indexed on 2010/05/09 20:38 UTC
Read the original article Hit count: 277

Filed under:


I would like to get all combination of a number without any repetation. Like 0.1.2, 0.2.1, 1.2.0, 1.0.2, 2.0.1, 2.1.0. I tried to find an easy scheme but couldn't find so I drawed a graph/tree for it and this screams to use recursion. But I would like to do it without, if this is possible. So could anyone please help mw how to do that?

Thank you in advance,


© Stack Overflow or respective owner

Related posts about permutation

Related posts about recursion