题目例如以下:Given a collection of numbers, return all possible permutations. For example, [1,2,3] have the following permutations: [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], and [3,2,1]. 分析:假设仅仅是求排列数非常好算,可是要打印全部排列且不反复比較困难. 假设单纯用for循环或递归.非常easy出现死循环. 而假设…