I need to generate all permutations for a list of numbers. List of numbers will be from 1 to n. Also the size of permutation can be 1 to m. So if given n=4, m=3, i need to have permutations:
111
112
113
114
121
122
123
124
131
132
133
134
142
142
143
144
211.....
and so on..
Also which of recursion/iteration should be used and why ?