- permutation, combination: 都是元素个数为
nums.length,所以终止条件是arr.size() == nums.length, 而subsets是直接加; - 因为subsets要记录遍历到当前在
nums中的index是哪一位从而好判断下一位加什么,所以dfs(... index)中有index, 而permutation, combination没有;
nums.length,所以终止条件是arr.size() == nums.length, 而subsets是直接加;nums中的index是哪一位从而好判断下一位加什么,所以dfs(... index)中有index, 而permutation, combination没有;