allcombinations

returns a list of all possible combinations / permutations of an array of items

permutation-sjt

A quite fast non-recursive permutation algorithm, Steinhaus–Johnson–Trotter algorithm (Even's speedup)