Permutations by swapping: Difference between revisions
m
→{{header|Julia}}
Line 1,647:
end
end
println("There were $iters iterations
end
johnsontrotter(1,4)
</lang>
Recursive (note this uses memory of roughtly (n+1)! bytes, where n is the number of elements, in order to store the accumulated permutations in a list, and so the above, iterative solution is to be preferred for
<lang julia>
function johnsontrotter(low, high)
|