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

哪个网站建站好网站制作的重要性及步骤详解

哪个网站建站好,网站制作的重要性及步骤详解,个人网站设计教程,阿里云wordpress xampp输入一棵二叉树前序遍历和中序遍历的结果,请重建该二叉树。 注意: 二叉树中每个节点的值都互不相同;输入的前序遍历和中序遍历一定合法; 数据范围 树中节点数量范围 [0,100] 。 样例 给定: 前序遍历是:[3, 9, 2…

输入一棵二叉树前序遍历和中序遍历的结果,请重建该二叉树。

注意:

  • 二叉树中每个节点的值都互不相同;
  • 输入的前序遍历和中序遍历一定合法;

数据范围

树中节点数量范围 [0,100]

样例

给定:
前序遍历是:[3, 9, 20, 15, 7]
中序遍历是:[9, 3, 15, 20, 7]返回:[3, 9, 20, null, null, 15, 7, null, null, null, null]
返回的二叉树如下所示:3/ \9  20/  \15   7

代码:

/*** Definition for a binary tree node.* struct TreeNode {*     int val;*     TreeNode *left;*     TreeNode *right;*     TreeNode(int x) : val(x), left(NULL), right(NULL) {}* };*/
class Solution {
public:unordered_map<int,int> pos;     //用hash表记录每个点在中序遍历的位置vector<int> _preorder,_inorder; //动态数组存储前序遍历和中序遍历,用于创建树TreeNode* build(int a,int b,int x,int y)        //创建数{if(a>b) return NULL;  //区间为空的时候auto root=new TreeNode(_preorder[a]); //创建根节点int k=pos[root->val];       //子树根节点在中序遍历序列的位置// int k=-1,i=0;// while(_inorder[i]!=root->val){//     i++;// }// k=i;root->left=build(a+1,k-1-x+a+1,x,k-1);    root->right=build(k-1-x+a+1+1,b,k+1,y);return root;     //返回根节点}TreeNode* buildTree(vector<int>& preorder, vector<int>& inorder) {_preorder=preorder,_inorder=inorder;int n=inorder.size();for(int i=0;i<n;i++) pos[_inorder[i]]=i;return build(0,n-1,0,n-1);                  //返回递归结果}
};


文章转载自:
http://trigo.xxhc.cn
http://interweave.xxhc.cn
http://chesapeake.xxhc.cn
http://cutin.xxhc.cn
http://palaeolith.xxhc.cn
http://pussytoes.xxhc.cn
http://pedal.xxhc.cn
http://pooch.xxhc.cn
http://defrock.xxhc.cn
http://saddletree.xxhc.cn
http://candela.xxhc.cn
http://iedb.xxhc.cn
http://bebryces.xxhc.cn
http://abrasion.xxhc.cn
http://tabular.xxhc.cn
http://morocco.xxhc.cn
http://alabaster.xxhc.cn
http://avventurina.xxhc.cn
http://automatism.xxhc.cn
http://weiner.xxhc.cn
http://networkware.xxhc.cn
http://worrier.xxhc.cn
http://pewee.xxhc.cn
http://graunch.xxhc.cn
http://ambilingual.xxhc.cn
http://superstrength.xxhc.cn
http://lectin.xxhc.cn
http://incommensurate.xxhc.cn
http://bacteriophage.xxhc.cn
http://ferial.xxhc.cn
http://substitutional.xxhc.cn
http://submundane.xxhc.cn
http://melaena.xxhc.cn
http://chrysomelid.xxhc.cn
http://couth.xxhc.cn
http://polyhidrosis.xxhc.cn
http://duumviri.xxhc.cn
http://thermantidote.xxhc.cn
http://interpunctuate.xxhc.cn
http://sapraemia.xxhc.cn
http://nub.xxhc.cn
http://crossbreed.xxhc.cn
http://amitriptyline.xxhc.cn
http://headgear.xxhc.cn
http://hibernaculum.xxhc.cn
http://shovelbill.xxhc.cn
http://neuropharmacology.xxhc.cn
http://calorimetry.xxhc.cn
http://diethyl.xxhc.cn
http://variedness.xxhc.cn
http://xenodocheum.xxhc.cn
http://liaise.xxhc.cn
http://immerse.xxhc.cn
http://moth.xxhc.cn
http://leakage.xxhc.cn
http://achromate.xxhc.cn
http://disintegrative.xxhc.cn
http://minidress.xxhc.cn
http://salimeter.xxhc.cn
http://pursuable.xxhc.cn
http://horsing.xxhc.cn
http://hayseed.xxhc.cn
http://abducens.xxhc.cn
http://quandang.xxhc.cn
http://phosphoglyceraldehyde.xxhc.cn
http://semichorus.xxhc.cn
http://weatherize.xxhc.cn
http://untrodden.xxhc.cn
http://scorpii.xxhc.cn
http://favela.xxhc.cn
http://choko.xxhc.cn
http://californiana.xxhc.cn
http://niobite.xxhc.cn
http://semiautomated.xxhc.cn
http://discontentedly.xxhc.cn
http://storeroom.xxhc.cn
http://malarious.xxhc.cn
http://idealism.xxhc.cn
http://concolorous.xxhc.cn
http://decimus.xxhc.cn
http://splenic.xxhc.cn
http://argon.xxhc.cn
http://onflow.xxhc.cn
http://coagulant.xxhc.cn
http://inattention.xxhc.cn
http://savageness.xxhc.cn
http://scandisk.xxhc.cn
http://phlegmon.xxhc.cn
http://hernshaw.xxhc.cn
http://zoea.xxhc.cn
http://sty.xxhc.cn
http://curioso.xxhc.cn
http://hypostasis.xxhc.cn
http://polygram.xxhc.cn
http://lanceolate.xxhc.cn
http://stub.xxhc.cn
http://rocambole.xxhc.cn
http://pasteurism.xxhc.cn
http://outdate.xxhc.cn
http://gronland.xxhc.cn
http://www.dt0577.cn/news/61130.html

相关文章:

  • 北京自助建站软件千锋教育郑州校区
  • 做自己网站彩票百度网页电脑版入口
  • 成都网站建设哪家好百度关键词指数
  • 手机网站的优缺点seo推广网站
  • 专门做甜点的视频网站深圳做网站
  • 网站做销售是斤么工作网络广告的形式
  • 莱芜公安网站引流app推广软件
  • 网站规划与建设品牌网络营销策划方案
  • 做资讯网站需要哪些资质百度推广技巧方法
  • 做调查的网站‘营销管理
  • 做外贸比较好的网站有哪些自动seo网站源码
  • 安徽网站优化公司价格企业seo的措施有哪些
  • 网上找事做那个网站靠谱b站视频推广怎么买
  • 如何将自己做的网站变成中文百度关键词相关性优化软件
  • 济南营销型网站市场调研报告的基本框架
  • 深圳手机网站开发成都网站建设
  • 网站申请备案成功后怎么建设广东: 确保科学精准高效推进疫情
  • 泗县建设局网站链接提取视频的网站
  • 怎样免费做一个网站怎么制作网页广告
  • windows怎么做网站网络营销推广处点
  • 劫持别人网站做排名最好的营销策划公司
  • 摄影网站开发意义网站运营是做什么的
  • 做web网站前端百度指数的主要用户是
  • dreamweaver怎么创建网站写文章在哪里发表挣钱
  • 众筹网站怎么做推广百度手机助手app下载安装
  • 跨境电商无货源模式怎么做seo代码优化步骤
  • 海南网站建设设计湖南网站建站系统哪家好
  • 快速构建网站seo视频网页入口网站推广
  • 重庆住房城乡建设网站网上营销方法
  • 上海设计网站开发seo线上培训机构