摘要: 1.将排序序列造成一个大顶堆(升序); 2.与末尾元素交换,此时末尾为最大值; 3.剩下的值执行重复执行上述操作。 从最后一个非叶子节点开始, 阅读全文
posted @ 2019-07-03 19:29 hhhl 阅读(123) 评论(0) 推荐(0) 编辑
摘要: class Solution { public void back(int n,ArrayList nums,List> output,int first){ if(first==n)output.add(new ArrayList(nums)); for(int i=first;i> permute(int[] nums) { int n... 阅读全文
posted @ 2019-07-03 19:06 hhhl 阅读(175) 评论(0) 推荐(0) 编辑