Data source: http://rosettacode.org/wiki/Permutations_by_swapping