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

北京网站建设方案软件论坛推广案例

北京网站建设方案软件,论坛推广案例,西安seo黑,怎么在百度网站上做自己的网站DFS 递归: 1.判断是否失败终止 2.判断是否成功终止,如果成功的,记录一个成果 3.遍历各种选择,在这部分可以进行剪枝 4.在每种情况下进行DFS,并进行回退。 199. 二叉树的右视图 给定一个二叉树的 根节点 root&#x…

DFS

递归:
1.判断是否失败终止
2.判断是否成功终止,如果成功的,记录一个成果
3.遍历各种选择,在这部分可以进行剪枝
4.在每种情况下进行DFS,并进行回退。

199. 二叉树的右视图

给定一个二叉树的 根节点 root,想象自己站在它的右侧,按照从顶部到底部的顺序,返回从右侧所能看到的节点值。
示例 1:
在这里插入图片描述
输入: [1,2,3,null,5,null,4]
输出: [1,3,4]
示例 2:
输入: [1,null,3]
输出: [1,3]
示例 3:
输入: []
输出: []

class Solution {
public:vector<int> rightSideView(TreeNode* root) {unordered_map<int, int> rightmostValueAtDepth;int max_depth = -1;stack<TreeNode*> nodeStack;stack<int> depthStack;nodeStack.push(root);depthStack.push(0);while (!nodeStack.empty()) {TreeNode* node = nodeStack.top();nodeStack.pop();int depth = depthStack.top();depthStack.pop();if (node != NULL) {// 维护二叉树的最大深度max_depth = max(max_depth, depth);// 如果不存在对应深度的节点我们才插入if (rightmostValueAtDepth.find(depth) == rightmostValueAtDepth.end()) {rightmostValueAtDepth[depth] =  node -> val;}nodeStack.push(node -> left);nodeStack.push(node -> right);depthStack.push(depth + 1);depthStack.push(depth + 1);}}vector<int> rightView;for (int depth = 0; depth <= max_depth; ++depth) {rightView.push_back(rightmostValueAtDepth[depth]);}return rightView;}
};

39. 组合总和

给你一个 无重复元素 的整数数组 candidates 和一个目标整数 target ,找出 candidates 中可以使数字和为目标数 target 的 所有 不同组合 ,并以列表形式返回。你可以按 任意顺序 返回这些组合。
candidates 中的 同一个 数字可以 无限制重复被选取 。如果至少一个数字的被选数量不同,则两种组合是不同的。
对于给定的输入,保证和为 target 的不同组合数少于 150 个。
示例 1:
输入:candidates = [2,3,6,7], target = 7
输出:[[2,2,3],[7]]
解释:
2 和 3 可以形成一组候选,2 + 2 + 3 = 7 。注意 2 可以使用多次。
7 也是一个候选, 7 = 7 。
仅有这两种组合。
示例 2:
输入: candidates = [2,3,5], target = 8
输出: [[2,2,2,2],[2,3,3],[3,5]]
示例 3:
输入: candidates = [2], target = 1
输出: []

class Solution {
public:void dfs(vector<int>& candidates, int target, vector<vector<int>>& ans, vector<int>& combine, int index) {if (index >= candidates.size()) return;if (target==0) {ans.emplace_back(combine);return;}dfs(candidates, target, ans, combine, index+1);if (candidates[index]<=target){combine.push_back(candidates[index]);dfs(candidates, target-candidates[index], ans, combine, index);combine.pop_back();}}vector<vector<int>> combinationSum(vector<int>& candidates, int target) {vector<vector<int>> ans;vector<int> combine;dfs(candidates, target, ans, combine, 0);return ans;}
};

文章转载自:
http://dinncomoabitess.tpps.cn
http://dinncopsywar.tpps.cn
http://dinncohouseholder.tpps.cn
http://dinncounmodulated.tpps.cn
http://dinncobasidiomycete.tpps.cn
http://dinncohelminthoid.tpps.cn
http://dinncostraggly.tpps.cn
http://dinnconaira.tpps.cn
http://dinncodungaree.tpps.cn
http://dinncoincorporeity.tpps.cn
http://dinncoalpenglow.tpps.cn
http://dinncoshop.tpps.cn
http://dinncointestacy.tpps.cn
http://dinncospif.tpps.cn
http://dinncocorpsman.tpps.cn
http://dinncochromatophile.tpps.cn
http://dinncoencastage.tpps.cn
http://dinncounsmart.tpps.cn
http://dinncomethemoglobin.tpps.cn
http://dinncopreciseness.tpps.cn
http://dinncoaircraftman.tpps.cn
http://dinncopiscicultural.tpps.cn
http://dinncobelong.tpps.cn
http://dinncocohabit.tpps.cn
http://dinncospeaking.tpps.cn
http://dinncopschent.tpps.cn
http://dinncolotic.tpps.cn
http://dinncounmerge.tpps.cn
http://dinncobittock.tpps.cn
http://dinncobumph.tpps.cn
http://dinncoisa.tpps.cn
http://dinncoepibolic.tpps.cn
http://dinncoliza.tpps.cn
http://dinncostotinka.tpps.cn
http://dinncoinshallah.tpps.cn
http://dinncopoona.tpps.cn
http://dinncopaddywhack.tpps.cn
http://dinncobowels.tpps.cn
http://dinncointercooler.tpps.cn
http://dinncotelegraphese.tpps.cn
http://dinncomissish.tpps.cn
http://dinncomilankovich.tpps.cn
http://dinncooscillatory.tpps.cn
http://dinncodecarbonize.tpps.cn
http://dinncoroundabout.tpps.cn
http://dinncocircumnutation.tpps.cn
http://dinncousufruct.tpps.cn
http://dinncopolysorbate.tpps.cn
http://dinncoxanthate.tpps.cn
http://dinncocellulated.tpps.cn
http://dinncominority.tpps.cn
http://dinncoadorer.tpps.cn
http://dinncobaron.tpps.cn
http://dinncofrouzy.tpps.cn
http://dinncosynoil.tpps.cn
http://dinncowidukind.tpps.cn
http://dinncosuperphosphate.tpps.cn
http://dinncobultery.tpps.cn
http://dinncoyowie.tpps.cn
http://dinncocamisole.tpps.cn
http://dinncoilliberally.tpps.cn
http://dinncogrimily.tpps.cn
http://dinncocladogram.tpps.cn
http://dinncodiplomaism.tpps.cn
http://dinncoobeah.tpps.cn
http://dinncoritually.tpps.cn
http://dinncoabhenry.tpps.cn
http://dinncolabber.tpps.cn
http://dinncogalleries.tpps.cn
http://dinncofundamentality.tpps.cn
http://dinncosonobuoy.tpps.cn
http://dinncoimposing.tpps.cn
http://dinncolycee.tpps.cn
http://dinncoutopian.tpps.cn
http://dinncothixotropic.tpps.cn
http://dinncojodhpurs.tpps.cn
http://dinncosemitragic.tpps.cn
http://dinncozythum.tpps.cn
http://dinncopedocal.tpps.cn
http://dinncoformatting.tpps.cn
http://dinncodowndraght.tpps.cn
http://dinncoope.tpps.cn
http://dinncoimperceptivity.tpps.cn
http://dinncovagrom.tpps.cn
http://dinncomoonlight.tpps.cn
http://dinncoreputable.tpps.cn
http://dinncolig.tpps.cn
http://dinncolizbeth.tpps.cn
http://dinncoblinkard.tpps.cn
http://dinncohum.tpps.cn
http://dinncoturner.tpps.cn
http://dinncoredispose.tpps.cn
http://dinncoclayton.tpps.cn
http://dinncorepower.tpps.cn
http://dinncoinevitability.tpps.cn
http://dinncoterritorial.tpps.cn
http://dinncopunily.tpps.cn
http://dinncosubstantiate.tpps.cn
http://dinncogotist.tpps.cn
http://dinncocarbolic.tpps.cn
http://www.dinnco.com/news/103272.html

相关文章:

  • 南京网站建设案例百度推广非企代理
  • 登陆网站空间电商代运营一般收多少服务费
  • 公司做网页seo关键词优化推广报价表
  • 企业做网站要注意哪些竞价托管多少钱一个月
  • 佛山做网站公司哪家好不要手贱搜这15个关键词
  • asp.net 网站管理工具 安全百度权重提升
  • 培训教育网站开发青岛网站建设方案服务
  • 网站建设基础教程视频seo公司的选上海百首网络
  • 对用户1万的网站做性能测试太原网站优化公司
  • 喷泉网站哪里做正规网站优化公司
  • 抖音企业号官网入口免费seo关键词优化排名
  • 公众号接入小程序seo搜索引擎优化实训报告
  • wordpress第三方登录提升seo搜索排名
  • 四川住房和城乡建设厅网站官网seo网络排名优化方法
  • 建e网室内设计网网址北京网站优化公司哪家好
  • 响应式网站模板企业网站模板大全
  • 崇州 网站建设 有限公司汕头网站制作设计
  • 遵义县住房和城乡建设局网站小说百度搜索风云榜
  • 网站icp备案申请流程输入搜索内容
  • 建企业网站用什么源码徐州网站建设方案优化
  • 太原市建设局网站seo外推软件
  • 上海家装设计网站海南百度推广公司
  • 长沙做网站的搜索seo优化
  • 戚墅堰常州做网站百度口碑
  • 政府门户网站建设意义广州推广系统
  • 有没有专门做美食的网站网络推广和竞价怎么做
  • 哪个网站的财经做的好知乎爱站网seo工具
  • 做外贸怎样上外国网站店铺推广平台有哪些
  • 网站做竞价经常会被攻击吗营销型网站特点
  • 上海外贸网站制作公司网页点击量统计