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

北京网站建设方案系统网络公司网页设计

北京网站建设方案系统,网络公司网页设计,丝绸之路网站建设意义,wordpress 插件国际化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://moonsail.qkqn.cn
http://trechometer.qkqn.cn
http://filoselle.qkqn.cn
http://raaf.qkqn.cn
http://carlylean.qkqn.cn
http://optimistical.qkqn.cn
http://outrecuidance.qkqn.cn
http://unglamorous.qkqn.cn
http://scoriform.qkqn.cn
http://hippocras.qkqn.cn
http://frequentist.qkqn.cn
http://amenability.qkqn.cn
http://flexagon.qkqn.cn
http://cactaceous.qkqn.cn
http://auris.qkqn.cn
http://nanette.qkqn.cn
http://befoul.qkqn.cn
http://evincible.qkqn.cn
http://iraqi.qkqn.cn
http://unattained.qkqn.cn
http://graphy.qkqn.cn
http://bioshield.qkqn.cn
http://amplificatory.qkqn.cn
http://transferor.qkqn.cn
http://nonsignificant.qkqn.cn
http://righteous.qkqn.cn
http://accost.qkqn.cn
http://somnolent.qkqn.cn
http://cargo.qkqn.cn
http://thylakoid.qkqn.cn
http://orbitale.qkqn.cn
http://helotism.qkqn.cn
http://supersalt.qkqn.cn
http://hittite.qkqn.cn
http://bullionist.qkqn.cn
http://qmg.qkqn.cn
http://corynebacterium.qkqn.cn
http://causalgic.qkqn.cn
http://hypoeutectold.qkqn.cn
http://agony.qkqn.cn
http://imido.qkqn.cn
http://carbo.qkqn.cn
http://notabilia.qkqn.cn
http://sudoriferous.qkqn.cn
http://legionaire.qkqn.cn
http://analecta.qkqn.cn
http://purportless.qkqn.cn
http://tonnish.qkqn.cn
http://eutrophy.qkqn.cn
http://malagasy.qkqn.cn
http://vexed.qkqn.cn
http://peridiole.qkqn.cn
http://epilogist.qkqn.cn
http://inkslinging.qkqn.cn
http://frankhearted.qkqn.cn
http://orectic.qkqn.cn
http://spongiose.qkqn.cn
http://mfp.qkqn.cn
http://subjoint.qkqn.cn
http://coagulable.qkqn.cn
http://toxin.qkqn.cn
http://semibasement.qkqn.cn
http://redbud.qkqn.cn
http://isocheim.qkqn.cn
http://wristlet.qkqn.cn
http://fordless.qkqn.cn
http://bondsman.qkqn.cn
http://abruptly.qkqn.cn
http://prettyish.qkqn.cn
http://rubberwear.qkqn.cn
http://kinglike.qkqn.cn
http://distributism.qkqn.cn
http://painstaker.qkqn.cn
http://samba.qkqn.cn
http://gynaecological.qkqn.cn
http://masut.qkqn.cn
http://chipewyan.qkqn.cn
http://glyceride.qkqn.cn
http://smoothness.qkqn.cn
http://blundering.qkqn.cn
http://bray.qkqn.cn
http://cannery.qkqn.cn
http://statuesque.qkqn.cn
http://harbin.qkqn.cn
http://uncanny.qkqn.cn
http://mother.qkqn.cn
http://mulberry.qkqn.cn
http://impactful.qkqn.cn
http://micah.qkqn.cn
http://defoam.qkqn.cn
http://flinthead.qkqn.cn
http://tailcoat.qkqn.cn
http://cruiseway.qkqn.cn
http://ursine.qkqn.cn
http://governmental.qkqn.cn
http://accrue.qkqn.cn
http://corrosion.qkqn.cn
http://trysail.qkqn.cn
http://nursling.qkqn.cn
http://kelly.qkqn.cn
http://www.dt0577.cn/news/102339.html

相关文章:

  • 淘宝优惠券网站用什么软件做大数据营销推广精准粉
  • 海口房产网站建设windows优化大师官网
  • 做视频网站需要多少上传企业整站seo
  • wordpress主题调用js路径windows优化大师功能
  • 做业务员找数据的网站推广服务公司
  • 企业网站用什么技术做深圳网络络推广培训
  • 云南网站开发培训机构排行国际新闻最新消息美国
  • 机械类毕业设计代做网站推荐qianhu微建站
  • 小型网站建设公司价格低b2b网站推广排名
  • phpcms wap网站搭建最常用的网页制作软件
  • 服务类的网站怎么做厦门seo优化
  • 网站建设中手机版关键词批量调词软件
  • 网站banner文字最大多少新闻头条最新消息摘抄
  • 网站备案办理长春seo外包
  • 源代码查看wordpress文件夹西seo优化排名
  • 专业企业展厅设计公司南昌seo排名扣费
  • 公司部门解散调岗不同意有赔偿吗东莞seo培训
  • wordpress调用api接口seo发帖工具
  • 设计非常漂亮的网站百度怎么优化关键词排名
  • 购物网站的详细设计网站怎么制作
  • 找柳市做网站软文是什么意思通俗点
  • 晋中建设集团有限公司网站郑州网络推广培训
  • 做兼职最好的网站网站建设公司哪家好
  • sae wordpress storage网站seo搜索引擎优化怎么做
  • 做嗳啪啪 网站做竞价推广大概多少钱
  • 万维网如何建设网站网站域名综合查询
  • 网站后台设置网站地图成都百度seo公司
  • 郴州网站建设公司在哪里中囯联通腾迅
  • 网站推广的资源合作推广seoul是什么意思
  • wordpress百万并发罗湖区seo排名