Iterate once and only once through all the possible configurations of an array

all the possible configurations of an array

If by this you mean all the permutations, then check out Heap’s algorithm – and a recent implementation posted to the forum, here: