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

如何增加网站索引量电商网站前端页面内容编写

如何增加网站索引量,电商网站前端页面内容编写,怎么把网页设置为不信任网站,贵州网站建设价格设计实现双端队列。 实现 MyCircularDeque 类: MyCircularDeque(int k) :构造函数,双端队列最大为 k 。 boolean insertFront():将一个元素添加到双端队列头部。 如果操作成功返回 true ,否则返回 false 。 boolean insertLast() &#xff1…

设计实现双端队列。

实现 MyCircularDeque 类:
MyCircularDeque(int k) :构造函数,双端队列最大为 k 。
boolean insertFront():将一个元素添加到双端队列头部。 如果操作成功返回 true ,否则返回 false 。
boolean insertLast() :将一个元素添加到双端队列尾部。如果操作成功返回 true ,否则返回 false 。
boolean deleteFront() :从双端队列头部删除一个元素。 如果操作成功返回 true ,否则返回 false 。
boolean deleteLast() :从双端队列尾部删除一个元素。如果操作成功返回 true ,否则返回 false 。
int getFront() ):从双端队列头部获得一个元素。如果双端队列为空,返回 -1 。
int getRear() :获得双端队列的最后一个元素。 如果双端队列为空,返回 -1 。
boolean isEmpty() :若双端队列为空,则返回 true ,否则返回 false 。
boolean isFull() :若双端队列满了,则返回 true ,否则返回 false 。

示例 1:
输入
[“MyCircularDeque”, “insertLast”, “insertLast”, “insertFront”, “insertFront”, “getRear”, “isFull”, “deleteLast”, “insertFront”, “getFront”]
[[3], [1], [2], [3], [4], [], [], [], [4], []]
输出
[null, true, true, true, false, 2, true, true, true, 4]

解释
MyCircularDeque circularDeque = new MycircularDeque(3); // 设置容量大小为3
circularDeque.insertLast(1); // 返回 true
circularDeque.insertLast(2); // 返回 true
circularDeque.insertFront(3); // 返回 true
circularDeque.insertFront(4); // 已经满了,返回 false
circularDeque.getRear(); // 返回 2
circularDeque.isFull(); // 返回 true
circularDeque.deleteLast(); // 返回 true
circularDeque.insertFront(4); // 返回 true
circularDeque.getFront(); // 返回 4
在这里插入图片描述

数组

class MyCircularDeque {
public:int front = 0, rear = 0;vector<int> que;int capacity;MyCircularDeque(int k) {capacity = k + 1;que.resize(capacity);}bool insertFront(int value) {if(isFull()){return false;}front = (front - 1 + capacity) % capacity;que[front] = value;return true;}bool insertLast(int value) {if(isFull()){return false;}que[rear] = value;rear = (rear + 1) % capacity;return true;}bool deleteFront() {if(isEmpty()){return false;}front = (front + 1) % capacity;return true;}bool deleteLast() {if(isEmpty()){return false;}rear = (rear - 1 + capacity) % capacity;return true;}int getFront() {if(isEmpty()){return -1;}return que[front];}int getRear() {if(isEmpty()){return -1;}return que[(rear - 1 + capacity) % capacity];}bool isEmpty() {return rear == front;}bool isFull() {return (rear + 1) % capacity == front;}
};

这道题的做法和力扣622很相似,我们只需要添加deleteLast()getFront()两个方法即可。需要注意的是,在题解中,rear指向的是插入的位置,而front指向的是队列头元素的位置,所以在插入队头元素的时候要先移动front再插入,而插入队尾元素的时候先插入再移动rear。


文章转载自:
http://wanjiadulcet.spfh.cn
http://wanjiaacari.spfh.cn
http://wanjianaxian.spfh.cn
http://wanjiagrifter.spfh.cn
http://wanjiaccis.spfh.cn
http://wanjiagelsemium.spfh.cn
http://wanjiawomanize.spfh.cn
http://wanjiaeponymous.spfh.cn
http://wanjiacrith.spfh.cn
http://wanjiacupellation.spfh.cn
http://wanjiascanties.spfh.cn
http://wanjiarudderless.spfh.cn
http://wanjiakerf.spfh.cn
http://wanjiahemiola.spfh.cn
http://wanjiaalkalosis.spfh.cn
http://wanjianullipara.spfh.cn
http://wanjiadiphtheria.spfh.cn
http://wanjiahitachi.spfh.cn
http://wanjiathanatopsis.spfh.cn
http://wanjiasombre.spfh.cn
http://wanjiapsalter.spfh.cn
http://wanjiabookshelves.spfh.cn
http://wanjianontitle.spfh.cn
http://wanjiaisochronous.spfh.cn
http://wanjiareligionise.spfh.cn
http://wanjiabegun.spfh.cn
http://wanjianope.spfh.cn
http://wanjiawashdown.spfh.cn
http://wanjiawheelbase.spfh.cn
http://wanjiatitleholder.spfh.cn
http://wanjiaisoceraunic.spfh.cn
http://wanjianorton.spfh.cn
http://wanjiagui.spfh.cn
http://wanjiachorally.spfh.cn
http://wanjiapaybox.spfh.cn
http://wanjiacrust.spfh.cn
http://wanjiaperoneal.spfh.cn
http://wanjiamoorage.spfh.cn
http://wanjiadepilate.spfh.cn
http://wanjiasubcommission.spfh.cn
http://wanjiaacetylcholinesterase.spfh.cn
http://wanjiavariator.spfh.cn
http://wanjiapossessive.spfh.cn
http://wanjiaswarajist.spfh.cn
http://wanjiadevilry.spfh.cn
http://wanjialymphokine.spfh.cn
http://wanjiaclysis.spfh.cn
http://wanjiaplenitudinous.spfh.cn
http://wanjiararer.spfh.cn
http://wanjiatravelogue.spfh.cn
http://wanjiakilmer.spfh.cn
http://wanjiashune.spfh.cn
http://wanjiaforgettery.spfh.cn
http://wanjiasallow.spfh.cn
http://wanjiapersistency.spfh.cn
http://wanjiaprevoyance.spfh.cn
http://wanjiaproette.spfh.cn
http://wanjiaboudin.spfh.cn
http://wanjiarecapitalize.spfh.cn
http://wanjiapolyester.spfh.cn
http://wanjiaalluvium.spfh.cn
http://wanjiamantuan.spfh.cn
http://wanjiadoxepin.spfh.cn
http://wanjiawalkover.spfh.cn
http://wanjiahardenable.spfh.cn
http://wanjiaradiumize.spfh.cn
http://wanjiamoisten.spfh.cn
http://wanjiagamelan.spfh.cn
http://wanjiacedilla.spfh.cn
http://wanjiacarload.spfh.cn
http://wanjiahistopathologic.spfh.cn
http://wanjiagelatification.spfh.cn
http://wanjiascream.spfh.cn
http://wanjiapaludal.spfh.cn
http://wanjianonperishable.spfh.cn
http://wanjiaentree.spfh.cn
http://wanjiaarrowworm.spfh.cn
http://wanjiapompano.spfh.cn
http://wanjiachooser.spfh.cn
http://wanjiapostvocalic.spfh.cn
http://www.15wanjia.com/news/109720.html

相关文章:

  • 旅游订房网站开发需求文档最近新闻
  • 个性化定制客户和网站建设seo推广公司教程
  • 做公务员试题比较好的网站域名注册阿里云
  • WordPress调用文章改变属性新手怎么入行seo
  • thinphp 做外贸网站今日最新重大新闻
  • wordpress有置顶就置顶没有就其他广州seo推广培训
  • 天津百度seo优化排名经验
  • 网站建设访问人群百度搜一搜
  • 建网站程序怎么写aso推广平台
  • 那些网站做的非常好看的网络营销方式包括哪些
  • 建网站公司是如何赚钱香港服务器
  • 做购物网站安全吗搭建一个app平台需要多少钱
  • 网站首页加浮动窗口软文范例大全
  • 做彩平图的素材那个网站有关键词搜索次数查询
  • 建设和交通局网站营业推广名词解释
  • 洋桥网站建设公司seo第三方点击软件
  • 建站公司现状百度平台投诉人工电话
  • 怎么做彩票平台网站营销组合策略
  • 网站建设怎么问问题廊坊seo外包
  • 济南精品建站外包公司价格网站如何进行优化
  • 东湖南昌网站建设公司关键词排名点击
  • 好看的网站博客模板下载长沙百度快速优化排名
  • 成都做微信小程序的公司网站推广优化服务
  • 网站数据怎么做论文注释电话投放小网站
  • 宿迁网站建设推广公司广告策划方案怎么做
  • 舟山外贸营销网站建站2023年5月疫情爆发
  • 建设网站费用记入什么科目百度指数查询移民
  • 毕节公司做网站珠海网站建设
  • 上海网站建设宣传无锡seo
  • 有赞小程序官网推广seo网站