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]. 用深度搜索的方法搜索下面的一棵树(示例,非完整的树),每次搜索到叶子时经过的路径就是一个排列. 代码如下: public class Solution…