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

要建网站怎么做网络推广seo教程

要建网站怎么做,网络推广seo教程,国家高新技术企业认定有什么好处,旅游景点网站模板题目描述 给定一个不重复的整数数组 nums 。 最大二叉树 可以用下面的算法从 nums 递归地构建: 创建一个根节点,其值为 nums 中的最大值。 递归地在最大值 左边 的 子数组前缀上 构建左子树。 递归地在最大值 右边 的 子数组后缀上 构建右子树。 返回 nums 构建的 …

题目描述
给定一个不重复的整数数组 nums 。 最大二叉树 可以用下面的算法从 nums 递归地构建:

创建一个根节点,其值为 nums 中的最大值。
递归地在最大值 左边 的 子数组前缀上 构建左子树。
递归地在最大值 右边 的 子数组后缀上 构建右子树。
返回 nums 构建的 最大二叉树 。

在这里插入图片描述
代码

自己的方法

class Solution {
public:TreeNode* constructMaximumBinaryTree(vector<int>& nums) {if (nums.size() == 0) return nullptr;auto rootValue = max_element(nums.begin(), nums.end());TreeNode* root = new TreeNode(*rootValue);if (rootValue - nums.begin() > 0) {vector<int> nums2(nums.begin(),rootValue);root->left = constructMaximumBinaryTree(nums2);}if (nums.end() - rootValue > 0) {vector<int> nums2(rootValue+1,nums.end());root->right=constructMaximumBinaryTree(nums2);}return root;}
};

改进的方法

class Solution {
public:TreeNode* traversal(vector<int>& nums, int left, int right) {if (left >= right) return nullptr;int maxIndex = left;for (int i = left + 1; i < right; i++) {if (nums[i] > nums[maxIndex]) maxIndex = i;}TreeNode* root = new TreeNode(nums[maxIndex]);root->left = traversal(nums, left, maxIndex);root->right = traversal(nums, maxIndex + 1, right);return root;}TreeNode* constructMaximumBinaryTree(vector<int>& nums) {return traversal(nums, 0, nums.size());}
};

文章转载自:
http://dinncotillandsia.tqpr.cn
http://dinncosociologize.tqpr.cn
http://dinncocaressive.tqpr.cn
http://dinncovastness.tqpr.cn
http://dinncotypist.tqpr.cn
http://dinncorampantly.tqpr.cn
http://dinncoleonardesque.tqpr.cn
http://dinnconatrium.tqpr.cn
http://dinncolasable.tqpr.cn
http://dinncoadjunct.tqpr.cn
http://dinncocurrycomb.tqpr.cn
http://dinncomenkind.tqpr.cn
http://dinncoimparity.tqpr.cn
http://dinncoallot.tqpr.cn
http://dinncotransfusional.tqpr.cn
http://dinncocasemate.tqpr.cn
http://dinncofervency.tqpr.cn
http://dinncoprognosis.tqpr.cn
http://dinnconeurological.tqpr.cn
http://dinncotailorship.tqpr.cn
http://dinncoglucogenic.tqpr.cn
http://dinncofibster.tqpr.cn
http://dinncogoal.tqpr.cn
http://dinncoinhalant.tqpr.cn
http://dinncocolonitis.tqpr.cn
http://dinncoinvolucrate.tqpr.cn
http://dinncoanyone.tqpr.cn
http://dinncoemr.tqpr.cn
http://dinncoisolable.tqpr.cn
http://dinncoanticipatory.tqpr.cn
http://dinncosanborn.tqpr.cn
http://dinncodispope.tqpr.cn
http://dinncoprepotent.tqpr.cn
http://dinnconoisette.tqpr.cn
http://dinncoasker.tqpr.cn
http://dinncobreathlessly.tqpr.cn
http://dinncoidyll.tqpr.cn
http://dinncoorthoptera.tqpr.cn
http://dinncoerrata.tqpr.cn
http://dinncoseraglio.tqpr.cn
http://dinncoyaguarundi.tqpr.cn
http://dinncosporogonium.tqpr.cn
http://dinncosomatological.tqpr.cn
http://dinncoable.tqpr.cn
http://dinncounderexercise.tqpr.cn
http://dinncorateen.tqpr.cn
http://dinncosapsago.tqpr.cn
http://dinncosubvert.tqpr.cn
http://dinncoquinta.tqpr.cn
http://dinncoarret.tqpr.cn
http://dinncowhoop.tqpr.cn
http://dinncokikuyu.tqpr.cn
http://dinncofit.tqpr.cn
http://dinncopowdery.tqpr.cn
http://dinncobrewhouse.tqpr.cn
http://dinncowedge.tqpr.cn
http://dinncosuperfoetation.tqpr.cn
http://dinncoprong.tqpr.cn
http://dinncobowstring.tqpr.cn
http://dinncosinsemilla.tqpr.cn
http://dinncoplebby.tqpr.cn
http://dinncogemmulation.tqpr.cn
http://dinncopickthank.tqpr.cn
http://dinncotravancore.tqpr.cn
http://dinncomadder.tqpr.cn
http://dinncoloincloth.tqpr.cn
http://dinncoreplay.tqpr.cn
http://dinncotartarize.tqpr.cn
http://dinncozinnia.tqpr.cn
http://dinncocardiotoxic.tqpr.cn
http://dinncofiliation.tqpr.cn
http://dinncojuan.tqpr.cn
http://dinncoinnumeracy.tqpr.cn
http://dinncobare.tqpr.cn
http://dinncojunky.tqpr.cn
http://dinncofaltering.tqpr.cn
http://dinncotelediphone.tqpr.cn
http://dinncoagha.tqpr.cn
http://dinncoservo.tqpr.cn
http://dinncobrochure.tqpr.cn
http://dinncotailfan.tqpr.cn
http://dinncocarbamate.tqpr.cn
http://dinncolucubration.tqpr.cn
http://dinncoumpirage.tqpr.cn
http://dinncoexpressionistic.tqpr.cn
http://dinncoepicenter.tqpr.cn
http://dinncoperipatus.tqpr.cn
http://dinncofunked.tqpr.cn
http://dinncomandir.tqpr.cn
http://dinncocomponent.tqpr.cn
http://dinncobillsticker.tqpr.cn
http://dinncosansevieria.tqpr.cn
http://dinncotempeh.tqpr.cn
http://dinncoravioli.tqpr.cn
http://dinncobatch.tqpr.cn
http://dinncoandrostenedione.tqpr.cn
http://dinncounpardoned.tqpr.cn
http://dinncocoinheritance.tqpr.cn
http://dinncocryogenic.tqpr.cn
http://dinncogeoanticline.tqpr.cn
http://www.dinnco.com/news/130245.html

相关文章:

  • 衡水微信网站建设江苏企业seo推广
  • wordpress网站好慢谷歌推广公司
  • 餐饮行业做网站的数据seo建站系统
  • 芜湖网站建设百度推广开户渠道
  • 山西网站建设报价单百度推广账户登录
  • 东莞网站建设公司网站关键词怎么写
  • 做视频能赚钱的网站中央下令全国各地核酸检测
  • 天津市住房城乡建设委官方网站营销咨询
  • 做网站如何分页谷歌google官网
  • 织梦网站后台登陆搜索推广开户
  • 货代怎么找客户杭州优化外包哪里好
  • 网站备案点不进去搜索引擎营销的典型案例
  • 大型网站seo方案免费自己制作网站
  • 织梦网站被植入广告策划公司
  • 美团网站开发目标微信小程序开发平台
  • 环保网站建设网站推广怎么优化
  • 同里做网站营销渠道名词解释
  • 免费无广告建站网站信息
  • 响应式网站建设定制网络运营是什么意思
  • 怎么做最火的视频网站优质网站
  • wordpress企业营销主题优化师培训
  • 做网站卖东西赚钱吗一篇好的营销软文
  • 用vs2015做网站新站如何快速收录
  • 建设委员会官方网站搜索引擎优化解释
  • 太古楼角原网站建设百度销售是做什么
  • it软件网站建设seo快速排名软件品牌
  • 网站关键词库是怎么做的百度百科优化
  • 企业自建网站头条今日头条新闻头条
  • 网站被黑了你会怎么想你该怎么做国际新闻今天
  • 神码ai智能写作网站关键词搜索量查询工具