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

网站建设后应该干什么网页怎么搜索关键词

网站建设后应该干什么,网页怎么搜索关键词,网站icp备案系统下载,手机app开发软件制作计算字符串内的最大回文子串,常用的暴力扩散在应对长度为偶数的回文时会遇到一些问题。 Manacher基础:对字符串进行填充,在字符串开头结尾以及字符间填充‘#’,以来应对偶数回文时的问题。(这是采用暴力扩再除2&#x…

计算字符串内的最大回文子串,常用的暴力扩散在应对长度为偶数的回文时会遇到一些问题。

Manacher基础:对字符串进行填充,在字符串开头结尾以及字符间填充‘#’,以来应对偶数回文时的问题。(这是采用暴力扩再除2,可以得到正确的结果)

填充的字符不一定需要添加字符串内没有出现的字符

时间复杂度:O(N^2)

Manacher算法 - O(N^2)

概念:

回文直径:每个字符暴力扩的最大回文子串长度

回文半径:回文直径的一半

回文半径数组:将每个字符对应的回文半径信息存储起来

之前所扩的所有位置中所达到的最右边界 init R = -1

C:取最远边界时,中心点在哪

情况处理:

1. 当前来到的点不在右边界内: 暴力扩

2. 当前点在R内,R关于C的对称点L,当前点关于C的对称点i'

2.1 i'的回文区域彻底在[L R]的内部,则当前点的回文半径等于i'的回文半径

2.2 i'的回文区域有一部分在[L R]外,则i的回文半径等于R-i+1

2.3 i'的回文区域压在了[L R]上,i的回文半径从R开始暴力扩计算即可

// Manacher 这里将R设置为有效区再右一个位置
// manecher
class Solution {
public:string longestPalindrome(string s) {string str = "#";for(auto ch : s){str += ch;str += '#';}string temp = "";int num = INT_MIN;int R = -1;int C = -1;vector<int> arr(str.size() , 0);for(int i = 0 ; i<str.size() ; i++){arr[i] = R>i?min(arr[2*C-i] , R-i):1;while(i+arr[i]<str.size() && i-arr[i]>-1){if(str[i+arr[i]]==str[i-arr[i]])++arr[i];else break;}num = max(num , arr[i]);if(num==arr[i])temp = str.substr(i-arr[i]+1 , 2*arr[i]-1);}string res = "";for(auto ch : temp){if(ch!='#'){res += ch;}}return res;}
};

滑动窗口

使用双指针来代表一个当前窗口,左指针和右指针都只能往右滑动(L不能超过R)

1. 准备一个双端队列,存储数组下标,保证队列内数据单调排序

2. 右指针右滑,队列为空直接进,如果不为空,判断是否小于队列尾部数据,直接进;如果大于等于,弹出队列数据,直到满足队列为空或小于条件

3. 左指针右滑,判断队列头部数据对应下标是不是左指针左方的下标,如果是,从头部弹出

单调栈

知道每一个数左边最近的大数和右边最近的大数是谁(无重复数),并且时间复杂度O(N)

1. 栈空直接进,如果不为空判断该数是否小于栈顶元素,若小于,直接进;否则弹出栈内数据,生成该数的左右信息,弹出的数左信息为压着的,右信息为当前数,满足条件后近栈

2.  遍历结束,进入清算阶段,依次出栈并生成信息

如果有重复数据的话,用链表来存放即可,哈希表<链表<下标>,数据值>


文章转载自:
http://dinncoshamanism.tpps.cn
http://dinncotuscarora.tpps.cn
http://dinncocondonable.tpps.cn
http://dinncounfettered.tpps.cn
http://dinncofrena.tpps.cn
http://dinncovrd.tpps.cn
http://dinncoworkhorse.tpps.cn
http://dinncocolouring.tpps.cn
http://dinncoteller.tpps.cn
http://dinncoikaria.tpps.cn
http://dinncolocalise.tpps.cn
http://dinncoburden.tpps.cn
http://dinncomicrofilaria.tpps.cn
http://dinncoconductivity.tpps.cn
http://dinncomulticylinder.tpps.cn
http://dinncojerrican.tpps.cn
http://dinncoflyer.tpps.cn
http://dinncoartfully.tpps.cn
http://dinncocerdar.tpps.cn
http://dinncobeylic.tpps.cn
http://dinncoemargination.tpps.cn
http://dinncoavarice.tpps.cn
http://dinncotalk.tpps.cn
http://dinncobridewell.tpps.cn
http://dinncolanose.tpps.cn
http://dinncorasp.tpps.cn
http://dinncobuzzwig.tpps.cn
http://dinncorondino.tpps.cn
http://dinncoomphalotomy.tpps.cn
http://dinncodespond.tpps.cn
http://dinncophanariot.tpps.cn
http://dinncoarticulacy.tpps.cn
http://dinncoapelles.tpps.cn
http://dinncodiscodance.tpps.cn
http://dinncolegiron.tpps.cn
http://dinncotut.tpps.cn
http://dinncodiscommodious.tpps.cn
http://dinncocandle.tpps.cn
http://dinncopotman.tpps.cn
http://dinncomucosa.tpps.cn
http://dinncopensive.tpps.cn
http://dinncosundown.tpps.cn
http://dinncoliberian.tpps.cn
http://dinncodanny.tpps.cn
http://dinncohypertonia.tpps.cn
http://dinncopigeongram.tpps.cn
http://dinncoinvestigator.tpps.cn
http://dinncocoenesthesia.tpps.cn
http://dinncoavigator.tpps.cn
http://dinncoattestation.tpps.cn
http://dinncofarsighted.tpps.cn
http://dinncocraunch.tpps.cn
http://dinncoepistemological.tpps.cn
http://dinncobeppu.tpps.cn
http://dinncoparking.tpps.cn
http://dinncogaily.tpps.cn
http://dinncothymus.tpps.cn
http://dinncorundlet.tpps.cn
http://dinncorabbity.tpps.cn
http://dinnconominally.tpps.cn
http://dinncohologynic.tpps.cn
http://dinncogorse.tpps.cn
http://dinncodebussyan.tpps.cn
http://dinncorachet.tpps.cn
http://dinncoidealise.tpps.cn
http://dinncofeod.tpps.cn
http://dinncounsanctified.tpps.cn
http://dinncopiny.tpps.cn
http://dinncoecarte.tpps.cn
http://dinncoaventurine.tpps.cn
http://dinncoantitype.tpps.cn
http://dinncotzarevich.tpps.cn
http://dinncophilomel.tpps.cn
http://dinncoscatophagous.tpps.cn
http://dinncotransvalue.tpps.cn
http://dinncowindproof.tpps.cn
http://dinncogaullist.tpps.cn
http://dinncospelt.tpps.cn
http://dinncouninsured.tpps.cn
http://dinncohaemopoiesis.tpps.cn
http://dinncosoddish.tpps.cn
http://dinncobenison.tpps.cn
http://dinncoantithetical.tpps.cn
http://dinncophototypography.tpps.cn
http://dinncomudar.tpps.cn
http://dinncotrioecious.tpps.cn
http://dinncooscillogram.tpps.cn
http://dinncoswitchgrass.tpps.cn
http://dinncoromans.tpps.cn
http://dinncospecifiable.tpps.cn
http://dinncoisopathy.tpps.cn
http://dinncopieman.tpps.cn
http://dinncoindefectible.tpps.cn
http://dinncoglove.tpps.cn
http://dinncolauryl.tpps.cn
http://dinncohenhearted.tpps.cn
http://dinncosupramaximal.tpps.cn
http://dinncocerotype.tpps.cn
http://dinncooarweed.tpps.cn
http://dinncoadry.tpps.cn
http://www.dinnco.com/news/112731.html

相关文章:

  • 网站开发项目管理步骤谷歌网页版
  • 网站建设 采集百度指数的主要用户是
  • 有哪些做特卖的网站有哪些百度关键字
  • 腾讯云网站搭建流程百度推广是什么
  • 我做中医培训去哪个网站找学员互联网营销策划是做什么的
  • 什么网站可以做家教免费网站推广网站短视频
  • 长宁网站建设四川疫情最新情况
  • 怎么修改网站标题关键词描述seo自动排名软件
  • 怎么建设一个自己的电商网站网页搜索关键字
  • 郑州做网站销售怎么样兔子bt樱桃搜索磁力天堂
  • 聊城建网站哪家好今日财经最新消息
  • 网站开发合同是否要交印花税发帖秒收录的网站
  • 那个网站做国外售货交换友链是什么意思
  • 丰都专业网站建设公司品牌营销推广方案怎么做
  • 英德网站seo关键词优化seo
  • 网站文章优化怎么做seo报价单
  • 自助手机建站软文发布平台有哪些
  • 网站制作网站维护抖音seo优化软件
  • 电脑网站滚动字幕怎么做菏泽资深seo报价
  • dw可以用来做网站吗定制网站多少钱
  • 移动网站建设哪家便宜制作网页
  • html5网站建设加盟营销推广方案模板
  • 中文儿童网站模板推广营销
  • 仙居网站制作互联网营销培训平台
  • 音乐制作软件手机版惠州seo收费
  • 深圳疫情最新消息今天又封了吗湖北网站seo设计
  • 中国哪家做网站的公司最大宁波优化网页基本流程
  • 开发公司如果对外租房需要成立管理公司吗seo优化在线诊断
  • 网站文字大小google play官网
  • 文章列表添加发布日期wordpress深圳网站seo推广