What is the best way of looping through an array, ending up organizing it in all possible ways it can be organized in?
Suppose we have an array:
{a, b, c, d}
What I would like to do with this is organize it like so:
{b, a, c, d}
{b, d, c, a}
And so forth, looping around creating one array to analyze per looping.
Thank you,