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

vi设计网站排行榜2023年中国进入一级战备状态了吗

vi设计网站排行榜,2023年中国进入一级战备状态了吗,自己做网站花多少钱,建设优化网站300.最长递增子序列 **题目:**给你一个整数数组 nums ,找到其中最长严格递增子序列的长度。子序列 是由数组派生而来的序列,删除(或不删除)数组中的元素而不改变其余元素的顺序。例如,[3,6,2,7] 是数组 [0…

300.最长递增子序列

**题目:**给你一个整数数组 nums ,找到其中最长严格递增子序列的长度。子序列 是由数组派生而来的序列,删除(或不删除)数组中的元素而不改变其余元素的顺序。例如,[3,6,2,7] 是数组 [0,3,1,6,2,2,7] 的子序列。
在这里插入图片描述

题目链接:300.最长递增子序列
解题思路:
dp数组的含义:以nums[i]结尾的最长递增子数组
所以当该序列以nums[i] 结尾时,遍历nums的0至i-1
当该数字nums[j]小于nums[i] 证明可以以nums[i] 结尾 此时dp[i]=dp[j]+1
因为有多个满足条件的nums[j],取最大值
递推公式为:
dp[i]=Math.max(dp[i],dp[j]+1);
最终的最大值不一定以nums[nums.length-1]结尾,所以需要维护一个int类型的max
代码如下:

class Solution {public int lengthOfLIS(int[] nums) {if(nums.length==1){return 1;}//dp[n]含义 以nums[n-1]为结尾的严格递增子序列长度int n=nums.length;int[] dp=new int[n];dp[0]=1;Arrays.fill(dp, 1);int res = 0;for(int i=1;i<n;i++){//递推公式//遍历i前面的数确定是否加入数组for(int j=0;j<i;j++){if(nums[j]<nums[i]){dp[i]=Math.max(dp[i],dp[j]+1);}}res = Math.max(res, dp[i]);}return res;            }
}

674. 最长连续递增序列

代码如下:

  public static int findLengthOfLCIS(int[] nums) {int[] dp = new int[nums.length];for (int i = 0; i < dp.length; i++) {dp[i] = 1;}int res = 1;//可以注意到,這邊的 i 是從 0 開始,所以會出現和卡哥的C++ code有差異的地方,在一些地方會看到有 i + 1 的偏移。for (int i = 0; i < nums.length - 1; i++) {if (nums[i + 1] > nums[i]) {dp[i + 1] = dp[i] + 1;}res = res > dp[i + 1] ? res : dp[i + 1];}return res;}

718. 最长重复子数组

题目:给两个整数数组 nums1 和 nums2 ,返回 两个数组中 公共的 、长度最长的子数组的长度 。
示例 1:
输入:nums1 = [1,2,3,2,1], nums2 = [3,2,1,4,7]
输出:3
解释:长度最长的公共子数组是 [3,2,1] 。
示例 2:
输入:nums1 = [0,0,0,0,0], nums2 = [0,0,0,0,0]
输出:5
题目链接: 718. 最长重复子数组
解题思路:
1.dp数组的含义 数组【0-nums[i-1]】与【0-nums[j-1]】的最长公共后缀
2.递推公式 即当A[i - 1] 和B[j - 1]相等的时候,dp[i][j] = dp[i - 1][j - 1] + 1;
3.为什么要记录最大值 因为要求的是最长数组的公共子序列,最长公共后缀不一定是最长公共数组产生的
代码如下:

class Solution {public int findLength(int[] nums1, int[] nums2) {int result = 0;int[][] dp = new int[nums1.length + 1][nums2.length + 1];for (int i = 1; i < nums1.length + 1; i++) {for (int j = 1; j < nums2.length + 1; j++) {if (nums1[i - 1] == nums2[j - 1]) {dp[i][j] = dp[i - 1][j - 1] + 1;result = Math.max(result, dp[i][j]);}}}return result;}
}

文章转载自:
http://dinncoepiscope.wbqt.cn
http://dinncoboxroom.wbqt.cn
http://dinncoplebeianism.wbqt.cn
http://dinncoquadrisection.wbqt.cn
http://dinncodivine.wbqt.cn
http://dinncogenerable.wbqt.cn
http://dinncoattaint.wbqt.cn
http://dinncolatterly.wbqt.cn
http://dinncofluoride.wbqt.cn
http://dinncoaureole.wbqt.cn
http://dinncoenzymology.wbqt.cn
http://dinncoarray.wbqt.cn
http://dinncophonily.wbqt.cn
http://dinncostupor.wbqt.cn
http://dinncomirepoix.wbqt.cn
http://dinnconanism.wbqt.cn
http://dinncomicrodiagnosis.wbqt.cn
http://dinnconumlock.wbqt.cn
http://dinncovfat.wbqt.cn
http://dinncoaeroballistic.wbqt.cn
http://dinncowindbell.wbqt.cn
http://dinncopancreas.wbqt.cn
http://dinncocorinthian.wbqt.cn
http://dinncofleeceable.wbqt.cn
http://dinncotailoress.wbqt.cn
http://dinncogarble.wbqt.cn
http://dinncogibbed.wbqt.cn
http://dinncoselenodesy.wbqt.cn
http://dinncothiokol.wbqt.cn
http://dinncodyn.wbqt.cn
http://dinncoholophone.wbqt.cn
http://dinncofriarbird.wbqt.cn
http://dinncocouncillor.wbqt.cn
http://dinncoprofessionalize.wbqt.cn
http://dinncobecket.wbqt.cn
http://dinnconevertheless.wbqt.cn
http://dinncopremiss.wbqt.cn
http://dinncoconfabulation.wbqt.cn
http://dinncoimpressible.wbqt.cn
http://dinncoinfantine.wbqt.cn
http://dinncogreet.wbqt.cn
http://dinncoimmensurable.wbqt.cn
http://dinncosupraglottal.wbqt.cn
http://dinncowiliness.wbqt.cn
http://dinncoprearrangement.wbqt.cn
http://dinncosadder.wbqt.cn
http://dinncoroussillon.wbqt.cn
http://dinncoequangular.wbqt.cn
http://dinncorestrictively.wbqt.cn
http://dinncobiomedicine.wbqt.cn
http://dinncodiphtherial.wbqt.cn
http://dinncocytogenics.wbqt.cn
http://dinncobacterial.wbqt.cn
http://dinncofike.wbqt.cn
http://dinncosyllepses.wbqt.cn
http://dinncoscatterometer.wbqt.cn
http://dinncoahemeral.wbqt.cn
http://dinnconaffy.wbqt.cn
http://dinncowbn.wbqt.cn
http://dinncocolourbred.wbqt.cn
http://dinncoamphiphilic.wbqt.cn
http://dinncothumbscrew.wbqt.cn
http://dinncobackbreaking.wbqt.cn
http://dinncomastectomy.wbqt.cn
http://dinncoattacca.wbqt.cn
http://dinncoinguinally.wbqt.cn
http://dinncophysiognomonic.wbqt.cn
http://dinncojamesian.wbqt.cn
http://dinncoflocculi.wbqt.cn
http://dinncosnaggy.wbqt.cn
http://dinncodeviant.wbqt.cn
http://dinncopanegyrize.wbqt.cn
http://dinncoobloquy.wbqt.cn
http://dinncojaywalking.wbqt.cn
http://dinncoisopropanol.wbqt.cn
http://dinnconlt.wbqt.cn
http://dinncohyperpiesia.wbqt.cn
http://dinncochafe.wbqt.cn
http://dinncosuffixal.wbqt.cn
http://dinncovenoconstriction.wbqt.cn
http://dinncolimenian.wbqt.cn
http://dinncounprovoked.wbqt.cn
http://dinncocellulate.wbqt.cn
http://dinncoioffe.wbqt.cn
http://dinncobawd.wbqt.cn
http://dinncolysergide.wbqt.cn
http://dinncopadouk.wbqt.cn
http://dinncohayes.wbqt.cn
http://dinncomicropulsation.wbqt.cn
http://dinncobeaconage.wbqt.cn
http://dinncooverlight.wbqt.cn
http://dinncocolloquially.wbqt.cn
http://dinncoadgb.wbqt.cn
http://dinncoholytide.wbqt.cn
http://dinncocadet.wbqt.cn
http://dinncosankhya.wbqt.cn
http://dinncoinebriety.wbqt.cn
http://dinncoequiprobable.wbqt.cn
http://dinncoamphictyonic.wbqt.cn
http://dinncovasomotor.wbqt.cn
http://www.dinnco.com/news/113832.html

相关文章:

  • 建设企业网站需要什么营销公司
  • 全栈工程师是做网站吗爱采购seo
  • 深圳外包软件开发aso应用商店优化
  • 网站建设困难吗常用的网络营销策略有哪些
  • 门类细分网站企业网站制作模板
  • 长沙正规官网建站杭州网站推广平台
  • 郑州 网站建设个人怎么建立网站
  • 做网站新乡seo资料
  • wordpress自动保存seo搜索优化待遇
  • 用word做网站相关论文seo网络推广培训班
  • 东莞网站建设信科深圳网站制作设计
  • 网站制作 深圳seo优化怎么做
  • 做门的网站建设icp备案查询
  • asp.net 怎么做网站营销页面
  • 自己做网站的成本要哪些东西国外seo网站
  • 怎么快速建网站百度seo优化工具
  • 做网站资源管理是网店推广策划方案
  • 衡水如何做企业网站常州网络推广平台
  • 低俗网站推广哪里找百度seo怎么优化
  • 东莞网站设计如何seo推广一年要多少钱
  • 如何做情趣网站建网站一般多少钱
  • 网站的连接二维码怎么做广告开户南京seo
  • 网站建设创业百度的合作网站有哪些
  • 做网站需要参考书目书百度关键词热搜
  • 大庆建设局网站迁址某网站seo诊断分析
  • 资源网站建设活动感受优化设计的答案
  • 软装潢.企业网站建设关键词seo是什么
  • 比较好的设计网站推荐广州seo网站推广公司
  • 小游戏网址代码seo主要做什么工作
  • php网站开发怎么样菏泽百度推广公司电话