http://qs321.pair.com?node_id=1230528


in reply to Re: Next permutation
in thread Next permutation

That is called a cross product :-)

It doesn't give the permutation ( 3 * 2 * 1 = 3! ) (The permutation of 3 objects gives 6 tuples. The cross product gives 3 * 3 * 3 = 27 tuples).