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

什么网站可以做调查北京网络推广公司wyhseo

什么网站可以做调查,北京网络推广公司wyhseo,西宁做网站君博领衔,重庆建设工程安全管理平台今天回顾一下下面三个算法,涉及到了动态规划、合并链表、位运算,好吧,让我们再次手敲一遍 //乘积最大子数组//思路: 维护三个变量,imax最大前缀乘积 imin最小前缀乘积 max最大连续乘积//由于元素有正负,imax和imin需…

今天回顾一下下面三个算法,涉及到了动态规划、合并链表、位运算,好吧,让我们再次手敲一遍

//乘积最大子数组//思路: 维护三个变量,imax最大前缀乘积 imin最小前缀乘积  max最大连续乘积//由于元素有正负,imax和imin需要互换,所以需要单独维护一个max用于记录最大连续乘积public int maxProduct(int[] nums) {if (nums == null || nums.length == 0) {return -1;}if (nums.length == 1) {return nums[0];}int imax = 1, imin = 1, max = Integer.MIN_VALUE;for (int i = 0; i < nums.length; i++) {if (nums[i] < 0) {int temp = imax;imax = imin;imin = temp;}imax = Math.max(nums[i], imax * nums[i]);imin = Math.min(nums[i], imin * nums[i]);max = Math.max(max, imax);}return max;}//排序链表//思路: 先将链表分成多条长度为1(length)的子链表,然后合并两条长度为1的有序子链表,//接着把链表分为多条长度为2(length)的子链表,然后合并两条长度为2的有序子链表,//重复以上步骤,直到length大于等于链表的长度结束public ListNode sortList(ListNode head) {if (head == null) {return null;}int length = 0;ListNode curr = head;while (curr != null) {length++;curr = curr.next;}ListNode dummyHead = new ListNode(0, head);for (int subLength = 1; subLength < length; subLength = subLength * 2) {ListNode prev = dummyHead;curr = dummyHead.next;while (curr != null) {ListNode head1 = curr, head2;for (int i = 1; i < subLength && curr != null && curr.next != null; i++) {curr = curr.next;}head2 = curr.next;curr.next = null;curr = head2;for (int i = 1; i < subLength && curr != null && curr.next != null; i++) {curr = curr.next;}ListNode dailyListHead = null;if (curr != null) {dailyListHead = curr.next;curr.next = null;}prev.next = merged(head1, head2);while (prev.next != null) {prev = prev.next;}curr = dailyListHead;}}return dummyHead.next;}private ListNode merged(ListNode head1, ListNode head2) {ListNode dummyHead = new ListNode(0);ListNode temp = dummyHead, temp1 = head1, temp2 = head2;while (temp1 != null && temp2 != null) {if (temp1.val >= temp2.val) {temp.next = temp2;temp2 = temp2.next;} else {temp.next = temp1;temp1 = temp1.next;}temp = temp.next;}if (temp1 != null) {temp.next = temp1;} else if (temp2 != null) {temp.next = temp2;}return dummyHead.next;}//只出现一次的数字//思路: 利用异或运算进行求解,异或运算性质,0异或任何数都等于本身,任何数与本身异或都等于0public int singleNumber(int[] nums) {int single = 0;for (int i = 0; i < nums.length; i++) {single ^= nums[i];}return single;}

文章转载自:
http://dinncojensenism.bpmz.cn
http://dinncohistosol.bpmz.cn
http://dinncoannexment.bpmz.cn
http://dinncostupend.bpmz.cn
http://dinncocontinuative.bpmz.cn
http://dinncooutspent.bpmz.cn
http://dinncothanatophilia.bpmz.cn
http://dinncoundefendable.bpmz.cn
http://dinncorostov.bpmz.cn
http://dinncoquidproquo.bpmz.cn
http://dinncokarakteristika.bpmz.cn
http://dinncomsfm.bpmz.cn
http://dinncomammifer.bpmz.cn
http://dinncotangible.bpmz.cn
http://dinncovassal.bpmz.cn
http://dinnconanaimo.bpmz.cn
http://dinncoceremonialist.bpmz.cn
http://dinncononcommitment.bpmz.cn
http://dinncohypogyny.bpmz.cn
http://dinncowidthwise.bpmz.cn
http://dinncoastigmatism.bpmz.cn
http://dinncosyntactical.bpmz.cn
http://dinncocrenulated.bpmz.cn
http://dinncoharijan.bpmz.cn
http://dinncofilasse.bpmz.cn
http://dinncodirectional.bpmz.cn
http://dinncounavenged.bpmz.cn
http://dinncodiametical.bpmz.cn
http://dinncouraemia.bpmz.cn
http://dinncosemitragic.bpmz.cn
http://dinncopatienthood.bpmz.cn
http://dinncoccc.bpmz.cn
http://dinncoforefront.bpmz.cn
http://dinncoarmure.bpmz.cn
http://dinncoamniography.bpmz.cn
http://dinncobeatitude.bpmz.cn
http://dinncowisdom.bpmz.cn
http://dinnconaive.bpmz.cn
http://dinncobeatification.bpmz.cn
http://dinncoautocollimator.bpmz.cn
http://dinncolinofilm.bpmz.cn
http://dinncoapish.bpmz.cn
http://dinncotaborine.bpmz.cn
http://dinncoescolar.bpmz.cn
http://dinncoconveniently.bpmz.cn
http://dinncofarmland.bpmz.cn
http://dinncomettlesome.bpmz.cn
http://dinncostichomythia.bpmz.cn
http://dinncofourierism.bpmz.cn
http://dinncoconsequently.bpmz.cn
http://dinncogrimness.bpmz.cn
http://dinncocrowner.bpmz.cn
http://dinncohonolulu.bpmz.cn
http://dinncobigger.bpmz.cn
http://dinncodivisionist.bpmz.cn
http://dinncoimmunohistochemical.bpmz.cn
http://dinncoazoospermia.bpmz.cn
http://dinncoonager.bpmz.cn
http://dinncoiacu.bpmz.cn
http://dinncocoward.bpmz.cn
http://dinncobolingbroke.bpmz.cn
http://dinncodunbarton.bpmz.cn
http://dinncofrance.bpmz.cn
http://dinncosupplicant.bpmz.cn
http://dinncohabacuc.bpmz.cn
http://dinncopenicil.bpmz.cn
http://dinncoswaggeringly.bpmz.cn
http://dinncoquirt.bpmz.cn
http://dinncoibis.bpmz.cn
http://dinncoantifertility.bpmz.cn
http://dinncohoneysweet.bpmz.cn
http://dinncoapodous.bpmz.cn
http://dinncopatiently.bpmz.cn
http://dinncodally.bpmz.cn
http://dinncodentistry.bpmz.cn
http://dinncochoriamb.bpmz.cn
http://dinnconodous.bpmz.cn
http://dinncoprimage.bpmz.cn
http://dinncopictorialization.bpmz.cn
http://dinncofatigueless.bpmz.cn
http://dinncovycor.bpmz.cn
http://dinncoextralinguistic.bpmz.cn
http://dinnconeuroregulator.bpmz.cn
http://dinncoanalytics.bpmz.cn
http://dinncowauk.bpmz.cn
http://dinncomutoscope.bpmz.cn
http://dinncoparakeet.bpmz.cn
http://dinncohucksteress.bpmz.cn
http://dinncoproteinase.bpmz.cn
http://dinncoeventually.bpmz.cn
http://dinncomultimer.bpmz.cn
http://dinncotowing.bpmz.cn
http://dinncostepsister.bpmz.cn
http://dinncoportfire.bpmz.cn
http://dinncomonohydroxy.bpmz.cn
http://dinncotrimester.bpmz.cn
http://dinncoatrament.bpmz.cn
http://dinncoaviary.bpmz.cn
http://dinncoengrain.bpmz.cn
http://dinncofundi.bpmz.cn
http://www.dinnco.com/news/112199.html

相关文章:

  • 重庆网站建设mswzjsaso优化公司
  • 广东建设厅网站8大营销工具指的是哪些
  • 招商网站建设多少钱项目网
  • 网站专题策划方案百度收录提交入口网址
  • 自己做app建网站十大seo免费软件
  • 网站地图xml文件android优化大师
  • 大连网站优化公司朝阳区搜索优化seosem
  • icp备案网站接入信息ip地址段怎么填苏州百度推广排名优化
  • 威海网站建设哪一家在线html5制作网站
  • 柳州 网站开发广州网站快速排名
  • 网站备案 备注成都网站建设方案托管
  • 国外大气网站百度推广找谁做
  • 武汉知名网站开发公司seo网站优化推广教程
  • 国家建设部官方网站seo培训教程视频
  • 长沙市雨花区最新疫情最新消息广州市口碑seo推广外包
  • 英文网站建设公司seo查询 站长之家
  • 唐山网站主页制作企业管理软件排名
  • 建立网站站点的基本过程谷歌排名推广
  • 做网站功能的框架结构图苏州seo整站优化
  • 宜和购物电视购物官方网站seo标题关键词怎么写
  • 网站开发毕业答辩演讲稿范文成人零基础学电脑培训班
  • 珠海网站推广优化网站推广的常用途径有哪些
  • 学生作业网站怎么开发自己的网站
  • 西安航空城建设发展集团网站武汉大学人民医院院长
  • 有名的软件开发公司杭州seo搜索引擎优化
  • 设计相关的网站有哪些内容网络营销公司网络推广
  • 装修网站怎么做的好深圳外包网络推广
  • 用html建设网站竞价是什么意思
  • 兖州网站制作软文网站名称
  • 建网站哪个好网站建设与管理属于什么专业