Recursively arrange non-repeated strings. Recursive strings
We can draw a graphical representation of the arrangement problem, that is, the arrangement enumeration tree, for example, the arrangement enumeration tree of {1, 2, 3}. This tree is exactly the same as the algorithm we introduced here;
Algorithm logic: (1) Full arrangement of n elements = (full arrangement of n-1 elements) + (prefix of another element); (2) Exit: if there is only one element in the full arrangement, it indicates that it has been completed, then the output array; (3) Each element is constantly placed as the first element, and then this element is used as the prefix, and the remaining elements continue to the full arrangement, wait until the exit, exit out also need to restore the array; reference from: http://blog.csdn.net/xiazdong/article/details/7986015