lintcode-线段树的修改-203
来源:互联网 发布:网络炒作团队怎么收费 编辑:程序博客网 时间:2024/06/15 20:13
/** * Definition of SegmentTreeNode: * class SegmentTreeNode { * public: * int start, end, max; * SegmentTreeNode *left, *right; * SegmentTreeNode(int start, int end, int max) { * this->start = start; * this->end = end; * this->max = max; * this->left = this->right = NULL; * } * } */class Solution {public: void modify(SegmentTreeNode *root, int index, int value) { if(!root) return ; if(root->start==root->end){ if(root->start==index) root->max=value; return ; } modify(root->left,index,value); modify(root->right,index,value); root->max=max(root->left->max,root->right->max); }};
0 0
- lintcode-线段树的修改-203
- LintCode:线段树的修改
- 线段树的修改-LintCode
- lintcode segment-tree-modify 线段树的修改
- LintCode:线段树的构造
- LintCode:线段树的查询
- lintcode线段树的应用
- lintcode -- 线段树的构造
- 线段树的构造-LintCode
- 线段树的查询-LintCode
- lintcode-线段树的构造-201
- lintcode-线段树的查询-202
- LintCode:线段树的构造 II
- LintCode:线段树的查询II
- 线段树的构造 II-LintCode
- lintcode-线段树
- 线段树的修改
- 线段树的修改
- POJ1644 放苹果
- 为Python添加默认模块搜索路径
- 【线性代数公开课MIT Linear Algebra】 第五课 排列矩阵、转置、向量空间与列空间
- Linux C编程学习笔记-------讲19图形界面编程
- ios9企业级应用部署说明(仅仅只对非AppStore程序)
- lintcode-线段树的修改-203
- javascript 设置图片透明度与图片的水平垂直旋转
- 6、权限设置
- hdu2824(欧拉函数+打表)
- [Android]init.rc的语法 Android Init Language
- linux c语言实现 执行shell命令
- 练习
- Shell编程(1)
- C++基础中易混淆点