diff --git a/problems/0046.全排列.md b/problems/0046.全排列.md index 5f7b1ac0..0b3174f0 100644 --- a/problems/0046.全排列.md +++ b/problems/0046.全排列.md @@ -147,6 +147,30 @@ public: Java: +class Solution { + List> result=new ArrayList>(); + Deque path=new LinkedList(); + void backtracking(int []nums,Boolean []used) { + if(path.size()==nums.length) { + result.add(new ArrayList(path)); + return; + } + for(int i=0;i> permute(int[] nums) { + Boolean []used=new Boolean[nums.length]; + for(int i=0;i