0,a 1,a2,…
An- 1}, then the complete permutation of s corresponds to the factorial number of n bits one by one. The corresponding way is: there are n ways to select the first element from n elements, and the subscript value of the selected element is an integer between 0 and n- 1, which is taken as the highest digit of the factorial number of n, and the rest elements are renumbered from 0 to n-2 according to the subscript, and the relative order is not changed when renumbering, so there are n- 1 ways to select the second element. The subscript value of the selected element is an integer between 0 and n-2, which is regarded as the second highest order of the n-bit factorial number ... There is only 1 method to select the last element, and the subscript value of the selected element is 0, which is regarded as the lowest order of the n-bit factorial number, so any permutation must correspond to an n-bit factorial number. Obviously, this correspondence is one to one. Question: Please use factorial method to generate a complete permutation from 1 to n. ..
[Algorithm Design] Firstly, all the n-bit factorials are generated in turn by adding one to the lowest bit, and the corresponding arrangement of any n-bit factorials is obtained by the above method.