I have array of size N, I need to generate all permutations variants of size K from this array. Variants [1 2 3] and [3 1 2] are different. Standard solutions which I found were
1) Just permutations, where I obtain all reordering of the same size as array.
2) Just combinations, where I obtain all combinations of size K from array of size N, but for these algorithms [1 2 6] and [6 1 2] are the same, while I need them to be different.
Could You help me to find an effective solution?
I should implement it on Matlab, but I hope I will be able to translate Your solutions from other languages.