码迷,mamicode.com
首页 >  
搜索关键字:binary trees    ( 12390个结果)
Leetcode #145 Binary Tree Postorder Traversal
题目链接:https://leetcode.com/problems/binary-tree-postorder-traversal/(非递归实现)二叉树的后序遍历。 1 class Solution 2 { 3 public: 4 vector postorderTraversal(Tre...
分类:其他好文   时间:2015-04-05 23:24:15    阅读次数:160
Leetcode #124 Binary Tree Maximum Path Sum
题目链接:https://leetcode.com/problems/binary-tree-maximum-path-sum/题中要求 maxPathSum(TreeNode *root)函数返回二叉树中最大的"Path Sum"。而这个最大的"Path Sum"可以被分解为三部分之和:"左子树的...
分类:其他好文   时间:2015-04-05 23:11:44    阅读次数:158
[LeetCode]199.Binary Tree Right Side View
题目Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom.For example: Given the following binary tree, 1...
分类:其他好文   时间:2015-04-05 22:00:55    阅读次数:201
树状数组(BIT)初学
BIT(Binary Indexed Tree,BIT) 树状数组。树状数组是一类怎样的数据结构呢?我们知道,树状数组是用来解决动态连续和的查询问题而诞生的。数据结构就是说,给你n个元素的数组a[1],a[2],a[3]....a[n](下标要从1开始)然后,支持以下两种操作: 1.Add...
分类:编程语言   时间:2015-04-05 18:42:55    阅读次数:151
[LeetCode] Binary Tree Postorder Traversal
Binary Tree Postorder Traversal Given a binary tree, return the postorder traversal of its nodes' values. For example: Given binary tree {1,#,2,3}, 1 2 / 3 ret...
分类:其他好文   时间:2015-04-05 16:04:34    阅读次数:151
HDU5200 Trees (离线处理)
HDU5200 Trees (离线处理)...
分类:其他好文   时间:2015-04-05 14:38:31    阅读次数:124
地图框架
使用苹果自带的地图框架,需要在项目中加载MapKit.framework(项目—TARGETS--Build Phases--Link Binary With Libraries),并在头文件中导入 #import 一、MKMapView的常用属性和方法 NSArray *annotations;//保存地图中的大头针 MKCoordinateRegion region; /...
分类:其他好文   时间:2015-04-05 12:03:02    阅读次数:137
Balanced Binary Tree--LeetCode
判断一个二叉树是否为平衡二叉树 int Depth(BinTree* root) { if(root == NULL) return 0; return max(Depth(root->left),Depth(root->right))+1; } bool isBalancedBinTree(BinTree* root) { if(root ==NULL) return 1; i...
分类:其他好文   时间:2015-04-05 12:02:53    阅读次数:104
Binary Tree Level Order Traversal--LeetCode
题目: Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level). For example: Given binary tree {3,9,20,#,#,15,7}, 3 / 9...
分类:其他好文   时间:2015-04-05 12:00:39    阅读次数:145
Binary Tree Level Order Traversal II--LeetCode
题目: Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root). For example: Given binary tree {3,9,20,...
分类:其他好文   时间:2015-04-05 11:58:39    阅读次数:111
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!