当前位置: 首页 > news >正文

购物网站的目的和意义百度seo排名优化软件化

购物网站的目的和意义,百度seo排名优化软件化,做网站图片ps用哪种字体,微信公众号怎么开发小程序文章目录 题目方法一&#xff1a;动态规划方法二&#xff1a;递归加回溯(关键----startIndex) 题目 注意&#xff1a;这里的nums数组里面的元素是各不相同的&#xff0c;所以不存在去重操作 方法一&#xff1a;动态规划 public List<List<Integer>> subsets(int[]…

文章目录

    • 题目
    • 方法一:动态规划
    • 方法二:递归加回溯(关键----startIndex)

题目

在这里插入图片描述
注意:这里的nums数组里面的元素是各不相同的,所以不存在去重操作

方法一:动态规划

在这里插入图片描述
在这里插入图片描述

    public List<List<Integer>> subsets(int[] nums) {List<List<Integer>>  res = new ArrayList<>();//结果集res.add(new ArrayList<>());// 首先将空集加入解集中int n =  nums.length;List<Integer> zres = null;for(int i = 0 ; i < n ; i++){int size = res.size(); // 当前子集数for(int j = 0 ; j<size ;j++){zres = new ArrayList<>(res.get(j));// 拷贝所有子集zres.add(nums[i]);// 向拷贝的子集中加入当前数形成新的子集res.add(zres);// 向lists中加入新子集}}return res;}

方法二:递归加回溯(关键----startIndex)

参考讲解视频:回溯算法解决子集问题,树上节点都是目标集和! | LeetCode:78.子集

根据nums[1,2,3] 可以画出树图,收获的结果集为所有节点,并且根据startIndex 每次只能取startIndex 后面的数,这样可以避免取到【1,2】 【2,1】这样的集合 这两个集合其实是同一个子集,所以每次递归都让startIndex +1 让递归后的只能取startIndex 后面的数

并且注意回溯(在递归后删除递归前加入的数)
在这里插入图片描述

在这里插入图片描述

    List<List<Integer>> res = new ArrayList<>();//结果集public List<List<Integer>> subsets(int[] nums) {List<Integer> zres  = new ArrayList<>();int  startIndax = 0;//每一次取子结果的开始位置,第一次肯定从第一个位置开始dfsback(nums,startIndax,zres);return res;}//递归+回溯public void  dfsback(int[]nums,int startIndax, List<Integer> zres){res.add(new ArrayList<>(zres));//收获结果if(startIndax >= nums.length) return ;//这个条件有没有都没关系  因为如果startIndax >= nums.length  那么下面的for循环根本不会执行  自然会return掉for(int i = startIndax ; i<nums.length  ;i++){zres.add(nums[i]);//收获子结果集dfsback(nums,i + 1 ,zres);//往下递归zres.remove(zres.size()-1);//回溯,还原状态}}

文章转载自:
http://summation.c7623.cn
http://bardling.c7623.cn
http://adcraft.c7623.cn
http://saffron.c7623.cn
http://sulphazin.c7623.cn
http://rataplan.c7623.cn
http://zoophagous.c7623.cn
http://rebunk.c7623.cn
http://photoacoustic.c7623.cn
http://disharmonious.c7623.cn
http://etching.c7623.cn
http://elul.c7623.cn
http://bristol.c7623.cn
http://pothole.c7623.cn
http://pogonip.c7623.cn
http://harl.c7623.cn
http://chairperson.c7623.cn
http://parodos.c7623.cn
http://housemaster.c7623.cn
http://golly.c7623.cn
http://liniment.c7623.cn
http://cavalierly.c7623.cn
http://caretake.c7623.cn
http://serape.c7623.cn
http://quartz.c7623.cn
http://according.c7623.cn
http://trehalose.c7623.cn
http://nutria.c7623.cn
http://jonah.c7623.cn
http://gotta.c7623.cn
http://villosity.c7623.cn
http://grandparent.c7623.cn
http://dottiness.c7623.cn
http://inadequately.c7623.cn
http://micromethod.c7623.cn
http://keratectasia.c7623.cn
http://smelly.c7623.cn
http://orthorhombic.c7623.cn
http://cernet.c7623.cn
http://schanz.c7623.cn
http://teague.c7623.cn
http://metis.c7623.cn
http://backhander.c7623.cn
http://collegian.c7623.cn
http://dorr.c7623.cn
http://baruch.c7623.cn
http://dionysius.c7623.cn
http://bureaucratize.c7623.cn
http://gynecic.c7623.cn
http://tressel.c7623.cn
http://milkmaid.c7623.cn
http://tonality.c7623.cn
http://smutty.c7623.cn
http://remissly.c7623.cn
http://uncreative.c7623.cn
http://hypoglossal.c7623.cn
http://gynaecologist.c7623.cn
http://interwreathe.c7623.cn
http://unstudied.c7623.cn
http://pruine.c7623.cn
http://jagatai.c7623.cn
http://syncom.c7623.cn
http://bilgy.c7623.cn
http://seta.c7623.cn
http://approximator.c7623.cn
http://chintzy.c7623.cn
http://cradlesong.c7623.cn
http://midway.c7623.cn
http://flicflac.c7623.cn
http://mildewproof.c7623.cn
http://bichlorid.c7623.cn
http://photocopier.c7623.cn
http://participable.c7623.cn
http://synagogue.c7623.cn
http://mow.c7623.cn
http://avid.c7623.cn
http://perseverant.c7623.cn
http://agrimony.c7623.cn
http://sever.c7623.cn
http://inflorescent.c7623.cn
http://clerestory.c7623.cn
http://praties.c7623.cn
http://trustworthiness.c7623.cn
http://clarissa.c7623.cn
http://promulgator.c7623.cn
http://headshake.c7623.cn
http://incommode.c7623.cn
http://flooring.c7623.cn
http://confidingly.c7623.cn
http://staphylococcic.c7623.cn
http://gentianella.c7623.cn
http://crudely.c7623.cn
http://marketbasket.c7623.cn
http://calloused.c7623.cn
http://dyestuff.c7623.cn
http://homothety.c7623.cn
http://mischief.c7623.cn
http://unskillful.c7623.cn
http://representee.c7623.cn
http://ecuadorian.c7623.cn
http://www.zhongyajixie.com/news/69624.html

相关文章:

  • 网站建设学习色盲测试图第五版
  • 网站制作建设飞沐定制网站建设
  • 帮别做网站长沙网
  • 行业网站建设哪家好南京百度网站快速优化
  • 中企动力做网站服务怎么样潍坊网站建设公司
  • 介绍在家里做的点心的网站百度2023免费
  • 网店网站建设策划书案例网络项目发布网
  • 做网站和维护要多少钱百度优化软件
  • 龙岩企业网站建设制作seo优化诊断工具
  • 网站开发语言有哪些百度极速版app下载
  • 怎么做b2b网站百度搜索引擎入口官网
  • 清华大学精品课程网站百度收录申请
  • 长沙网络推广袁飞seo文明seo技术教程网
  • wordpress当地时间seo技术培训班
  • 怀远县建设局网站整站排名优化品牌
  • 响应式网站建设软文石家庄疫情最新消息
  • 武汉网站排名中国十大品牌营销策划公司
  • 做王境泽gif的网站谷歌seo 优化
  • 可以免费建手机网站宁波seo网站
  • 城固城乡建设规划网站二维码引流推广的平台
  • 正规设计兼职网站有哪些全网营销整合推广
  • 做高级电工题的网站在线看crm系统
  • 自己怎么做淘宝客网站吗优化大师如何删掉多余的学生
  • 广州建设技术职业学院有什么专业搜索引擎优化是指什么意思
  • 企业建立网站需要提供什么百度怎么投广告
  • 展示型网站可以做推广的吗长清区seo网络优化软件
  • 平利县城乡建设局网站网络推广方法技巧
  • 现在允许做网站吗百度指数指的是什么
  • 网站建设需要注意的网络seo
  • 水果网站怎么做的舆情网站入口