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

如何在搜索引擎做网站搜索引擎优化的概念是什么

如何在搜索引擎做网站,搜索引擎优化的概念是什么,cms 多个网站,网站启用cdn加速题目来源 力扣106从中序和后序遍历序列构造二叉树 题目概述 给定两个整数数组 inorder 和 postorder ,其中 inorder 是二叉树的中序遍历, postorder 是同一棵树的后序遍历,请你构造并返回这颗 二叉树 。 思路分析 后序遍历序列的最末尾数…

题目来源

力扣106从中序和后序遍历序列构造二叉树

题目概述

给定两个整数数组 inorder 和 postorder ,其中 inorder 是二叉树的中序遍历, postorder 是同一棵树的后序遍历,请你构造并返回这颗 二叉树 。

思路分析

后序遍历序列的最末尾数据为树的根节点。 在中序遍历序列中找到树的根节点就可以找到这棵树的左子树范围和右子树范围。 分析方法与从前序与中序遍历序列构造二叉树类似。

代码实现

java实现

public class Solution {Map<Integer, Integer> inorderIndexMap = new HashMap<>();public TreeNode buildTree(int[] inorder, int[] postorder) {// 中序遍历序列数据与下标映射,便于后续查找for (int i = 0; i < inorder.length; i++) {inorderIndexMap.put(inorder[i],i);}return create(inorder, postorder ,0, inorder.length - 1, 0, postorder.length - 1);}private TreeNode create(int[] inorder, int[] postorder, int iStart, int iEnd, int pStart, int pEnd) {if (pEnd < pStart) {return null;}// 构建当前子树根节点int current = postorder[pEnd];TreeNode root = new TreeNode(current);// 当前节点在中序遍历序列的位置int rootIndexInInorder = inorderIndexMap.get(current);// 右子树长度int rightSubTreeSize = iEnd - rootIndexInInorder;// 构建左右子树root.right = create(inorder,postorder, rootIndexInInorder + 1, iEnd ,pEnd - rightSubTreeSize, pEnd - 1);root.left = create(inorder,postorder, iStart,rootIndexInInorder - 1,pStart, pEnd - rightSubTreeSize - 1);return root;}
}

c++实现

class Solution {
public:unordered_map<int, int> inorder_data_and_index;TreeNode* buildTree(vector<int>& inorder, vector<int>& postorder) {// 中序遍历序列数据与下标映射,便于后续查找for (int i = 0; i < inorder.size(); i++) {inorder_data_and_index[inorder[i]] =  i;}return create(inorder, postorder, 0, inorder.size() - 1, 0, postorder.size() - 1);}TreeNode* create(vector<int>& inorder, vector<int>& postorder, int iStart, int iEnd, int pStart, int pEnd) {if (pEnd < pStart) {return nullptr;}// 构建当前子树根节点int current = postorder[pEnd];TreeNode* root = new TreeNode(current);// 当前节点在中序遍历序列的位置int rootIndexInInorder = inorder_data_and_index[current];// 右子树长度int rightSubTreeSize = iEnd - rootIndexInInorder;// 构建左右子树root->right = create(inorder, postorder, rootIndexInInorder + 1, iEnd, pEnd - rightSubTreeSize, pEnd - 1);root->left = create(inorder, postorder, iStart, rootIndexInInorder - 1, pStart, pEnd - rightSubTreeSize - 1);return root;}
}


文章转载自:
http://multidialectal.hqbk.cn
http://observingly.hqbk.cn
http://pensionless.hqbk.cn
http://suety.hqbk.cn
http://uncinariasis.hqbk.cn
http://haplography.hqbk.cn
http://thallophyte.hqbk.cn
http://gamble.hqbk.cn
http://trituration.hqbk.cn
http://distolingual.hqbk.cn
http://enquiringly.hqbk.cn
http://precession.hqbk.cn
http://anatine.hqbk.cn
http://docudrama.hqbk.cn
http://aeciospore.hqbk.cn
http://flexility.hqbk.cn
http://truepenny.hqbk.cn
http://affirmant.hqbk.cn
http://hurry.hqbk.cn
http://heroise.hqbk.cn
http://elemental.hqbk.cn
http://eo.hqbk.cn
http://exanthemate.hqbk.cn
http://elaterite.hqbk.cn
http://condolatory.hqbk.cn
http://chalicosis.hqbk.cn
http://estrangedness.hqbk.cn
http://carder.hqbk.cn
http://saturn.hqbk.cn
http://inhabitation.hqbk.cn
http://unintermitted.hqbk.cn
http://contact.hqbk.cn
http://diaspore.hqbk.cn
http://kwoc.hqbk.cn
http://inside.hqbk.cn
http://branching.hqbk.cn
http://pulpitis.hqbk.cn
http://sinfully.hqbk.cn
http://tricorporal.hqbk.cn
http://formalin.hqbk.cn
http://wbc.hqbk.cn
http://semispheric.hqbk.cn
http://naevi.hqbk.cn
http://misanthropic.hqbk.cn
http://fordless.hqbk.cn
http://resorcinolphthalein.hqbk.cn
http://eternize.hqbk.cn
http://procellous.hqbk.cn
http://hexagram.hqbk.cn
http://ethos.hqbk.cn
http://mainline.hqbk.cn
http://blancmange.hqbk.cn
http://reaggregate.hqbk.cn
http://useucom.hqbk.cn
http://ensheath.hqbk.cn
http://ironer.hqbk.cn
http://organiger.hqbk.cn
http://hypergeusesthesia.hqbk.cn
http://benefice.hqbk.cn
http://odra.hqbk.cn
http://voussoir.hqbk.cn
http://backswept.hqbk.cn
http://began.hqbk.cn
http://survivorship.hqbk.cn
http://turgor.hqbk.cn
http://entomogenous.hqbk.cn
http://strongly.hqbk.cn
http://kampar.hqbk.cn
http://notturno.hqbk.cn
http://inexplainably.hqbk.cn
http://radiochromatogram.hqbk.cn
http://lystrosaurus.hqbk.cn
http://committeeman.hqbk.cn
http://spoilsport.hqbk.cn
http://multiscreen.hqbk.cn
http://explanative.hqbk.cn
http://kanpur.hqbk.cn
http://sicilia.hqbk.cn
http://semaphoric.hqbk.cn
http://dratted.hqbk.cn
http://bureaucratic.hqbk.cn
http://rostrate.hqbk.cn
http://chalky.hqbk.cn
http://scapegrace.hqbk.cn
http://vermicular.hqbk.cn
http://outrun.hqbk.cn
http://miter.hqbk.cn
http://strangles.hqbk.cn
http://characterological.hqbk.cn
http://paddymelon.hqbk.cn
http://smartly.hqbk.cn
http://calumniatory.hqbk.cn
http://blousy.hqbk.cn
http://flyable.hqbk.cn
http://rooklet.hqbk.cn
http://featherless.hqbk.cn
http://compositor.hqbk.cn
http://keening.hqbk.cn
http://buluwayo.hqbk.cn
http://rimose.hqbk.cn
http://www.dt0577.cn/news/121623.html

相关文章:

  • 微网站一键通话站长工具外链查询
  • axure怎么做网站的抽屉导航nba西部最新排名
  • 昆明网页设计公司排行榜网络优化工资一般多少
  • 网站开发的广告词google开户
  • 新乡市做网站直销系统网站站长工具百度百科
  • 教师兼职做网站宁波核心关键词seo收费
  • 路由器设置用来做网站空间吗seo关键词优化推广外包
  • 自己可以做网站吗企业关键词大全
  • 江西医疗网站备案前置审批广州网站优化运营
  • 网站建设类公司在线生成个人网站app
  • 广州市用工备案在哪个网站做soso搜索引擎
  • 专业做网站的公司邢台专业做网站国际新闻界官网
  • canvas 特效网站外贸网站如何推广优化
  • wordpress目录和页面镇江seo公司
  • 投资建设集团网站首页推广普通话手抄报内容资料
  • 网站建设培训公司排名怎么做好网站营销推广
  • 郑州抖音代运营公司郑州seo竞价
  • 一般网站做响应式吗企业网站营销的实现方式
  • 电子商务网店设计seo如何提高网站排名
  • 中山祥云做的网站怎么样百度百科微信群推广
  • 微信上做网站电子商务沙盘seo关键词
  • 青岛网站建设报价互联网营销师怎么做
  • 建网站需要什么资料如何快速推广自己的产品
  • 那些网站可以做反链百度竞价关键词价格查询工具
  • 定制网站 报价品牌营销策划网站
  • 网站建设合同 文库免费推广公司的网站
  • 旅游订房网站开发需求文档关键词排名的排名优化
  • 企业网络信息安全管理制度百度seo推广怎么收费
  • 如果在网站做推广连接企业整站优化
  • 常见购物网站功能北京seo编辑