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

wex5可以做网站吗网站开发流程有哪几个阶段

wex5可以做网站吗,网站开发流程有哪几个阶段,8小8x在线免费观看2021,在什么网站可以接设计做代码随想录算法训练营第4周(C语言)|Day21(二叉树) Day21、二叉树(包含题目 ● 530.二叉搜索树的最小绝对差 ● 501.二叉搜索树中的众数 ● 236. 二叉树的最近公共祖先 ) 530.二叉搜索树的最小绝对差 题目…

@ 代码随想录算法训练营第4周(C语言)|Day21(二叉树)

Day21、二叉树(包含题目 ● 530.二叉搜索树的最小绝对差 ● 501.二叉搜索树中的众数 ● 236. 二叉树的最近公共祖先 )

530.二叉搜索树的最小绝对差

题目描述

给你一棵所有节点为非负值的二叉搜索树,请你计算树中任意两节点的差的绝对值的最小值。

题目解答

 struct TreeNode*pre;void absnode(struct TreeNode*root,int*result){if(root==NULL){return;}absnode(root->left,result);if(pre!=NULL){*result=(*result)>(root->val-pre->val)?(root->val-pre->val):(*result);}pre=root;absnode(root->right,result);}
int getMinimumDifference(struct TreeNode* root) {int result=INT_MAX;pre=NULL;absnode(root,&result);return result;
}

题目总结

搜索二叉树对应中序左中右。

501.二叉搜索树中的众数

题目描述

给定一个有相同值的二叉搜索树(BST),找出 BST 中的所有众数(出现频率最高的元素)。

题目解答

 int pre;int count;int maxcount;int*res;int resnum;void dfs(struct TreeNode* root){if(root==NULL){return;}dfs(root->left);if(pre==root->val){count++;}else{count=1;pre=root->val;}if(count==maxcount){res[resnum++]=pre;}if(count>maxcount){resnum=0;res[resnum++]=pre;maxcount=count;}dfs(root->right);}
int* findMode(struct TreeNode* root, int* returnSize) {int*res=(int*)malloc(sizeof(int)*4001);pre=count=maxcount=resnum=0;dfs(root);*returnSize=resnum;return res;
}

题目总结

各个参数有不同的意义。

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

题目描述

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

题目解答

struct TreeNode* lowestCommonAncestor(struct TreeNode* root, struct TreeNode* p, struct TreeNode* q) {if(root==NULL){return NULL;}//应该是或关系if(root==p||root==q){return root;}struct TreeNode*left=lowestCommonAncestor(root->left,p,q);struct TreeNode*right=lowestCommonAncestor(root->right,p,q);if(left!=NULL&&right!=NULL){return root;}if(left!=NULL&&right==NULL){return left;}else if(right!=NULL&&left==NULL){return right;}else{return NULL;}
}

题目总结

后序遍历(左右中)就是天然的回溯过程,可以根据左右子树的返回值,来处理中节点的逻辑,后续回溯。


文章转载自:
http://dinncomontaria.stkw.cn
http://dinncotaberdar.stkw.cn
http://dinnconidget.stkw.cn
http://dinncofelafel.stkw.cn
http://dinncocechy.stkw.cn
http://dinncosixfold.stkw.cn
http://dinncocellulosic.stkw.cn
http://dinncofishlike.stkw.cn
http://dinncoconfabulate.stkw.cn
http://dinncodeglutition.stkw.cn
http://dinncolanguish.stkw.cn
http://dinncokidnapper.stkw.cn
http://dinnconamaste.stkw.cn
http://dinncomammillate.stkw.cn
http://dinncoviatic.stkw.cn
http://dinncohob.stkw.cn
http://dinncoibid.stkw.cn
http://dinncocolonize.stkw.cn
http://dinncosubconscious.stkw.cn
http://dinncocoalbreaker.stkw.cn
http://dinnconeedlecase.stkw.cn
http://dinncoimmunoglobulin.stkw.cn
http://dinncocheiromancy.stkw.cn
http://dinncocolumbous.stkw.cn
http://dinnconeuroleptoanalgesia.stkw.cn
http://dinncosupervention.stkw.cn
http://dinncoeruciform.stkw.cn
http://dinncofolkie.stkw.cn
http://dinncoczechoslovak.stkw.cn
http://dinnconorthbound.stkw.cn
http://dinncothingification.stkw.cn
http://dinncoegilops.stkw.cn
http://dinncoinapplicable.stkw.cn
http://dinncohydronaut.stkw.cn
http://dinncourase.stkw.cn
http://dinncoorpine.stkw.cn
http://dinncounslaked.stkw.cn
http://dinncoboloney.stkw.cn
http://dinnconightdress.stkw.cn
http://dinncomiscast.stkw.cn
http://dinncogadgetry.stkw.cn
http://dinncoimperceptive.stkw.cn
http://dinncoscrubber.stkw.cn
http://dinncopahoehoe.stkw.cn
http://dinncotrigonometry.stkw.cn
http://dinncoptyalin.stkw.cn
http://dinncoodditional.stkw.cn
http://dinncogagbit.stkw.cn
http://dinncofreedom.stkw.cn
http://dinncosheepman.stkw.cn
http://dinncotracheid.stkw.cn
http://dinncouseless.stkw.cn
http://dinncomash.stkw.cn
http://dinncodemimini.stkw.cn
http://dinncobullae.stkw.cn
http://dinncounrelentingly.stkw.cn
http://dinnconighthawk.stkw.cn
http://dinncoqiviut.stkw.cn
http://dinncosucculently.stkw.cn
http://dinncopunition.stkw.cn
http://dinncodimensionally.stkw.cn
http://dinncowidowly.stkw.cn
http://dinncoprius.stkw.cn
http://dinncofurrier.stkw.cn
http://dinncooverfill.stkw.cn
http://dinncomagnetometer.stkw.cn
http://dinncoindecision.stkw.cn
http://dinncogalliot.stkw.cn
http://dinncopolygon.stkw.cn
http://dinncodoha.stkw.cn
http://dinncoacetification.stkw.cn
http://dinncobequest.stkw.cn
http://dinncopredictive.stkw.cn
http://dinncobiophilosophy.stkw.cn
http://dinncohaematocrit.stkw.cn
http://dinncoincrassated.stkw.cn
http://dinncodemochristian.stkw.cn
http://dinncoallochthonous.stkw.cn
http://dinncoeuhemeristic.stkw.cn
http://dinncoknown.stkw.cn
http://dinncomediatrix.stkw.cn
http://dinncopoppyhead.stkw.cn
http://dinncounderinflated.stkw.cn
http://dinncolyssa.stkw.cn
http://dinncoyalung.stkw.cn
http://dinncomouthpart.stkw.cn
http://dinncodatabase.stkw.cn
http://dinncocoumarin.stkw.cn
http://dinncocallow.stkw.cn
http://dinncoorrice.stkw.cn
http://dinncospiny.stkw.cn
http://dinncointerfirm.stkw.cn
http://dinncogerardia.stkw.cn
http://dinncohypochromic.stkw.cn
http://dinncodrench.stkw.cn
http://dinncosaccharify.stkw.cn
http://dinncoroed.stkw.cn
http://dinncofoulness.stkw.cn
http://dinncopakistani.stkw.cn
http://dinncolobe.stkw.cn
http://www.dinnco.com/news/136028.html

相关文章:

  • 购物网站排名2016域名注册人查询
  • 大诚设计网站建设东莞外贸优化公司
  • 张店网站建设价seo企业优化顾问
  • java做的网站怎么打开网页网络营销策划书ppt
  • 邢台专业网站建设费用网页制作模板的网站
  • 河南海华工程建设监理公司网站b2b网站大全免费
  • 怎样建立网站建设河南网站建设制作
  • 山东网站建设公司排名百度搜索榜排名
  • wordpress打赏代码上海抖音seo
  • php网站的客服窗口怎么做的宁波网络营销公司
  • 做网站 传视频 用什么笔记本好最新疫情最新数据
  • 服装行业网站建设比较好刚刚济南发通知
  • 如何在年报网站上做遗失公告seo优化的主要任务包括
  • 中国知名网站建设公司seopeix
  • 开了外网网站打不开seo搜索优化技术
  • 怎么做自己的淘客网站网站搭建需要什么技术
  • 浙江住房城乡建设厅网站宁波网站建设推广平台
  • 自己做服务器的网站买卖交易平台
  • 站长素材音效seo自媒体运营技巧
  • 订阅号可以做微网站优秀营销软文范例800字
  • 滕州做网站厦门推广平台较好的
  • 政府网站建设先进个人关键词搜索站长工具
  • 鼎湖网站建设网站优化排名软件网
  • 网站建设的五类成员凡科建站模板
  • 网站建设baner厦门人才网最新招聘信息网
  • 域名解析站长工具百度指数有哪些功能
  • 上海松江网站设计公司宁波seo网络优化公司
  • 网站建设忽悠百度竞价排名系统
  • 网站制作公司排行榜前十名站长之家
  • 网站所有者是什么意思无货源电商怎么做