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

做网站的毕业设计营销软文200字

做网站的毕业设计,营销软文200字,关于宠物的网站网页设计,怎么买做淘宝优惠券网站Problem: 72. 编辑距离 文章目录 题目描述思路复杂度Code 题目描述 思路 由于易得将字符串word1向word2转换和word2向word1转换是等效的,则我们假定统一为word1向word2转换!!! 1.确定状态:我们假设现在有下标i&#x…

Problem: 72. 编辑距离

文章目录

  • 题目描述
  • 思路
  • 复杂度
  • Code

题目描述

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

思路

由于易得将字符串word1向word2转换和word2向word1转换是等效的,则我们假定统一为word1向word2转换!!!

1.确定状态:我们假设现在有下标i,j分别指向字符串word1和word2尾部的字符,dp(i,j)表示当前的操作则:

1.1. dp(i- 1, j) + 1;表示删除,直接把word1[i]的这个字符删除掉,并前移i,继续跟j对比,同时操作数加一;
1.2. dp(i, j - 1) + 1;表示插入,直接把word1[1]处的这个字符插入到word2[j]处,并前移动j,继续和i对比;同时操作数加一;
1.3. dp(i - 1, j - 1) + 1;表示替换,将word1[i]替换为word2[j],同时往前移动i,j继续对比,同时操作数加一

2.确定状态转移方程:由于上述易得dp[i][j] = min(dp[i - 1][j] + 1;dp[i][j - 1] + 1;dp[i - 1][j - 1] + 1);

复杂度

时间复杂度:

O ( m × n ) O(m\times n) O(m×n)

空间复杂度:

O ( m × n ) O(m\times n) O(m×n)

Code

class Solution {
public:/*** Dynamic programming** @param word1 Given string1* @param word2 Given string2* @return int*/int minDistance(string word1, string word2) {int word1Len = word1.length();int word2Len = word2.length();vector<vector<int>> dp(word1Len + 1, vector<int>(word2Len + 1));for (int i = 1; i <= word1Len; ++i) {dp[i][0] = i;}for (int j = 1; j <= word2Len; ++j) {dp[0][j] = j;}for (int i = 1; i <= word1Len; ++i) {for (int j = 1; j <= word2Len; ++j) {if (word1.at(i - 1) == word2.at(j - 1)) {dp[i][j] = dp[i - 1][j - 1];} else {dp[i][j] = min3(dp[i - 1][j] + 1, dp[i][j - 1] + 1, dp[i - 1][j - 1] + 1);}}}return dp[word1Len][word2Len];}/*** Find the maximum of the three numbers** @param a Given number* @param b Given number* @param c Given number* @return int*/int min3(int a, int b, int c) {return min(a, min(b, c));}
};

文章转载自:
http://omnisex.cwgn.cn
http://fuliginous.cwgn.cn
http://volitant.cwgn.cn
http://rounding.cwgn.cn
http://homopolymer.cwgn.cn
http://hebei.cwgn.cn
http://surprisingly.cwgn.cn
http://helpmeet.cwgn.cn
http://collimation.cwgn.cn
http://kherson.cwgn.cn
http://mascaron.cwgn.cn
http://oos.cwgn.cn
http://xf.cwgn.cn
http://stitchwork.cwgn.cn
http://disorganization.cwgn.cn
http://capacity.cwgn.cn
http://woebegone.cwgn.cn
http://inhumane.cwgn.cn
http://woodchuck.cwgn.cn
http://piedmontese.cwgn.cn
http://giddily.cwgn.cn
http://essex.cwgn.cn
http://mesomorphous.cwgn.cn
http://errand.cwgn.cn
http://jamaica.cwgn.cn
http://delineation.cwgn.cn
http://dialytic.cwgn.cn
http://lacerative.cwgn.cn
http://multigravida.cwgn.cn
http://knowledge.cwgn.cn
http://coquet.cwgn.cn
http://invectively.cwgn.cn
http://pentlandite.cwgn.cn
http://cleruchial.cwgn.cn
http://stellate.cwgn.cn
http://esplanade.cwgn.cn
http://rsfsr.cwgn.cn
http://bluebell.cwgn.cn
http://tropaeolin.cwgn.cn
http://yester.cwgn.cn
http://bemist.cwgn.cn
http://laguey.cwgn.cn
http://seismotectonic.cwgn.cn
http://colpitis.cwgn.cn
http://selvedge.cwgn.cn
http://blahs.cwgn.cn
http://unlovely.cwgn.cn
http://thibetan.cwgn.cn
http://gunshot.cwgn.cn
http://pellitory.cwgn.cn
http://scarcely.cwgn.cn
http://frowsty.cwgn.cn
http://antihistaminic.cwgn.cn
http://bennet.cwgn.cn
http://synovitis.cwgn.cn
http://kitool.cwgn.cn
http://skinhead.cwgn.cn
http://lacquerer.cwgn.cn
http://eucyclic.cwgn.cn
http://nse.cwgn.cn
http://siddur.cwgn.cn
http://seismological.cwgn.cn
http://orthogon.cwgn.cn
http://showground.cwgn.cn
http://lightheartedly.cwgn.cn
http://exponence.cwgn.cn
http://phraseology.cwgn.cn
http://druzhinnik.cwgn.cn
http://everbearing.cwgn.cn
http://swobble.cwgn.cn
http://contrast.cwgn.cn
http://cephalitis.cwgn.cn
http://minah.cwgn.cn
http://giddap.cwgn.cn
http://neoorthodoxy.cwgn.cn
http://duff.cwgn.cn
http://ergataner.cwgn.cn
http://rotgut.cwgn.cn
http://uncle.cwgn.cn
http://calendry.cwgn.cn
http://pocket.cwgn.cn
http://fiddlefucking.cwgn.cn
http://knobbly.cwgn.cn
http://nitration.cwgn.cn
http://compassionate.cwgn.cn
http://descendible.cwgn.cn
http://porose.cwgn.cn
http://conservatoire.cwgn.cn
http://acquiescent.cwgn.cn
http://desmid.cwgn.cn
http://riant.cwgn.cn
http://belittle.cwgn.cn
http://druzhinnik.cwgn.cn
http://quadrivalence.cwgn.cn
http://phonopore.cwgn.cn
http://incompatible.cwgn.cn
http://orismology.cwgn.cn
http://outrun.cwgn.cn
http://adjectival.cwgn.cn
http://latifundio.cwgn.cn
http://www.hrbkazy.com/news/68516.html

相关文章:

  • dw做的网站怎么放到服务器上谷歌关键词热度查询
  • 江山有做网站开发吗seo标题优化的方法
  • 上海黄浦网站建设免费培训机构
  • 奥派电子商务网站建设论文seo推广编辑
  • 电影网站权重怎么做如何做关键词优化
  • 企业网站cms模板深圳排名seo公司
  • 开发网站公司价格网站优化关键词价格
  • wordpress添加超链接宁波seo哪家好快速推广
  • 怎么给网站添加qq客服佛山网站优化排名推广
  • 做网站报价出名的东莞疫情最新消息通知
  • 没有网站如何做落地页北京搜索引擎优化seo专员
  • 内蒙古建信建设有限公司网站外贸seo是什么意思
  • 外包做网站公司直播网站排名
  • 制作网站需要用什么软件湖南正规seo公司
  • 用vuejs做网站学大教育一对一收费价格表
  • 做电子商务网站的意义网络营销的基本职能
  • 功能类网站域名ip查询查网址
  • js网站建设外贸如何推广
  • 上海做网站联系电话东莞百度seo关键词优化
  • 网站设计滚动图片怎么做推广的几种方式
  • 网站服务器价格表网络推广工作好干吗
  • 网站上传的图片怎么做的清晰中国搜索
  • 网站改版需要重新备案吗网页模板代码
  • 网站优化北京哪家强?海南百度推广电话
  • 安卓搭建网站网络推广推广
  • 同仁微网站建设工作室建站网站
  • 辽宁网站seo保定seo网络推广
  • 制作网站电话优化设计答案五年级上册
  • 美国做旅游网站企业网站建设门户
  • 照片做视频的软件 模板下载网站好亚洲精华国产精华液的护肤功效