Suppose I have a vector of integers like this:
A = [1 2 3] What I need is nth permutation of vector A. As we now a vector of n numbers has n! permutation, For example some permutation of A is:
[1 2 3] [1 3 2] [2 1 3] [2 3 1] ... Is there any built-in function for calculating nth permutation? if not, can anyone please offer me a efficient algorithm for calculate it? Any suggestion would be highly appreciated