How would you generate all the possible permutations of list b(1,6,8,3,9,5)
including ones of different length? Example:
List a = [1,2,3]
generateperms(a)
1,2,3
3,1,2
3,2,1
1,3,2
2,1,3
2,3,1
2,3
1,2
1,3
2,1
3,2
3,1
And so forth and getting all the permutarions of each length?
EDIT: I'm just going to use this, written in python, works well enough:
import itertools
a = ['a','b','c']
for i in range(len(a)):
print list(itertools.permutations(a,i+1))