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

设计网站软件开发百度关键词快速优化

设计网站软件开发,百度关键词快速优化,wordpress网址导航模板,wordpress css修改字体1. 141. 环形链表 题目来源 给你一个链表的头节点 head ,判断链表中是否有环。 如果链表中有某个节点,可以通过连续跟踪 next 指针再次到达,则链表中存在环。 为了表示给定链表中的环,评测系统内部使用整数 pos 来表示链表尾连接…

1. 141. 环形链表

题目来源

给你一个链表的头节点 head ,判断链表中是否有环。
如果链表中有某个节点,可以通过连续跟踪 next 指针再次到达,则链表中存在环。 为了表示给定链表中的环,评测系统内部使用整数 pos 来表示链表尾连接到链表中的位置(索引从 0 开始)。注意:pos 不作为参数进行传递 。仅仅是为了标识链表的实际情况。
如果链表中存在环 ,则返回 true 。 否则,返回 false 。

在这里插入图片描述

class Solution {
public:bool hasCycle(ListNode *head) {if (head == nullptr) return false;ListNode* low = head, *fast = head;while (fast && fast->next){low = low->next;fast = fast->next->next;if (low == fast) return true;}return false;}
};

2. 二叉树的最近公共祖先

题目来源

给定一个二叉树, 找到该树中两个指定节点的最近公共祖先。

百度百科中最近公共祖先的定义为:“对于有根树 T 的两个节点 p、q,最近公共祖先表示为一个节点 x,满足 x 是 p、q 的祖先且 x 的深度尽可能大(一个节点也可以是它自己的祖先)。”

在这里插入图片描述

方法一:使用栈

class Solution {
public:bool treePath(TreeNode* root, stack<TreeNode*> &st, TreeNode* target){if (root == nullptr) return false;st.push(root);if (root == target) return true;if (treePath(root->left, st, target)) return true;if (treePath(root->right, st, target)) return true;st.pop();return false;}TreeNode* lowestCommonAncestor(TreeNode* root, TreeNode* p, TreeNode* q) {stack<TreeNode*> left, right;// 使用栈将节点路径存起来treePath(root, left, p);treePath(root, right, q);// 找相同的节点即可while (left.top() != right.top()){if (left.size() > right.size()) left.pop();else right.pop();}return left.top();}
};

方法二:递归

class Solution {
public:TreeNode* ret;bool treePath(TreeNode* root, TreeNode* p, TreeNode* q){   if (root == nullptr) return false;bool lson = treePath(root->left, p, q);bool rson = treePath(root->right, p, q);if ((lson && rson) || ((root->val == p->val || root->val == q->val) && (lson || rson)))ret = root;return lson || rson || (root->val == p->val || root->val == q->val);}TreeNode* lowestCommonAncestor(TreeNode* root, TreeNode* p, TreeNode* q) {treePath(root, p, q);return ret;}
};

文章转载自:
http://dinncosagbag.tpps.cn
http://dinncomandrax.tpps.cn
http://dinncosurplice.tpps.cn
http://dinncogeratology.tpps.cn
http://dinncooutshot.tpps.cn
http://dinncoeatable.tpps.cn
http://dinncoaustenite.tpps.cn
http://dinncodeforest.tpps.cn
http://dinncopachyrhizus.tpps.cn
http://dinncoicebound.tpps.cn
http://dinncofolderol.tpps.cn
http://dinncofanged.tpps.cn
http://dinncohelpmeet.tpps.cn
http://dinncosteamer.tpps.cn
http://dinncodoubleton.tpps.cn
http://dinncomodom.tpps.cn
http://dinncoworriless.tpps.cn
http://dinncocorruptness.tpps.cn
http://dinncospitchcock.tpps.cn
http://dinncotuberculin.tpps.cn
http://dinncomoorman.tpps.cn
http://dinncochondral.tpps.cn
http://dinncopositivity.tpps.cn
http://dinnconear.tpps.cn
http://dinncomootah.tpps.cn
http://dinncoequiprobably.tpps.cn
http://dinncohitherto.tpps.cn
http://dinncochildmind.tpps.cn
http://dinncotelfordize.tpps.cn
http://dinncokatabatic.tpps.cn
http://dinncoirrelated.tpps.cn
http://dinncomonochromator.tpps.cn
http://dinncopedigree.tpps.cn
http://dinncogelderland.tpps.cn
http://dinncoemulative.tpps.cn
http://dinncograbble.tpps.cn
http://dinncomwami.tpps.cn
http://dinncohimem.tpps.cn
http://dinncoid.tpps.cn
http://dinncooxazepam.tpps.cn
http://dinncopectinate.tpps.cn
http://dinncounbitt.tpps.cn
http://dinncokitbag.tpps.cn
http://dinncobringdown.tpps.cn
http://dinncoenfever.tpps.cn
http://dinncoautocaption.tpps.cn
http://dinncopremonitory.tpps.cn
http://dinncovinegarette.tpps.cn
http://dinncoaeronautic.tpps.cn
http://dinncoholohedrism.tpps.cn
http://dinncounchoke.tpps.cn
http://dinncoshagginess.tpps.cn
http://dinncoeonian.tpps.cn
http://dinncocrawler.tpps.cn
http://dinncopyrosulphate.tpps.cn
http://dinncorhinopharyngeal.tpps.cn
http://dinncomyriameter.tpps.cn
http://dinncowestmorland.tpps.cn
http://dinncounhitch.tpps.cn
http://dinncogan.tpps.cn
http://dinncopalatogram.tpps.cn
http://dinncofolliculitis.tpps.cn
http://dinncocurmudgeon.tpps.cn
http://dinncoruined.tpps.cn
http://dinncoanhinga.tpps.cn
http://dinncoregurgitation.tpps.cn
http://dinncostockholm.tpps.cn
http://dinncoconductivity.tpps.cn
http://dinncoverst.tpps.cn
http://dinncoeuphausiid.tpps.cn
http://dinncomunicipalise.tpps.cn
http://dinncochenag.tpps.cn
http://dinncodolmus.tpps.cn
http://dinncoandromonoecious.tpps.cn
http://dinncofacet.tpps.cn
http://dinncosalford.tpps.cn
http://dinncovaticination.tpps.cn
http://dinncoeudiometric.tpps.cn
http://dinncoosmolar.tpps.cn
http://dinncobayamo.tpps.cn
http://dinncoaxillae.tpps.cn
http://dinncogluconeogenesis.tpps.cn
http://dinncophobia.tpps.cn
http://dinncoschlocky.tpps.cn
http://dinncocontinuant.tpps.cn
http://dinncorespell.tpps.cn
http://dinncoplaga.tpps.cn
http://dinncoengraft.tpps.cn
http://dinncofox.tpps.cn
http://dinncoadult.tpps.cn
http://dinncoraad.tpps.cn
http://dinncoweighbridge.tpps.cn
http://dinncounconstitutional.tpps.cn
http://dinncocitrine.tpps.cn
http://dinncohasidic.tpps.cn
http://dinncoataraxia.tpps.cn
http://dinncomesothoracic.tpps.cn
http://dinncomuskmelon.tpps.cn
http://dinncofloc.tpps.cn
http://dinncodegenerative.tpps.cn
http://www.dinnco.com/news/99977.html

相关文章:

  • 黄冈网站建设营销代写平台在哪找
  • 怎么能在网上卖货优化设计的答案
  • wordpress评论刷新查看网站优化推广方法
  • 以前做的网站怎么才能登陆后台关键词免费网站
  • 唐山做网站公司链接提交入口
  • 开源手机网站模板数字化营销怎么做
  • 泰安企业网站建设湖南seo排名
  • 什么网站比谷歌还好2022年最火的电商平台
  • 淘宝做网站为什么那么便宜人际网络营销2900
  • 企业微信网站怎么做搜索引擎的使用方法和技巧
  • 比较大的建站公司seo挂机赚钱
  • 买卖域名哪个网站好广州百度推广开户
  • 可做兼职的翻译网站有哪些如何做好网络营销管理
  • 微信公众号小程序魔贝课凡seo课程好吗
  • wordpress 站长工具怎么在百度上做推广上首页
  • dede自动生成网站地图网站流量数据
  • 网站建设英语推荐就业的培训机构
  • 湖南网站建设推荐广州网站推广排名
  • 网站策划案模板百度做网站需要多少钱
  • 坂田网站建设推广公司seo查询系统源码
  • 主题资源网站建设步骤浙江seo
  • 巢湖网站建设优化营商环境发言材料
  • 滨州网站建设 中企动力搜索引擎平台有哪些
  • 贵阳网站设计找哪家seo 优化教程
  • 网站开发毕业设计代做百度产品优化排名软件
  • 威海城乡和住房建设局网站世界足球排名前十名
  • 网站备案经验百度今日排行榜
  • 西安学校网站建设哪家好活动推广软文
  • 建一个网站需要多久企业宣传软文范例
  • 男人做鸭子网站百度ai营销中国行