Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest le...
分类:
其他好文 时间:
2015-07-20 23:00:05
阅读次数:
85
3.1 为什么需要泛型避免了强制转换,使代码更易读易写,也就减少了出bug的几率。提升了性能由于编译时做了更多的检查,运行时的检查就可以少做很多。JIT能够聪明地处理值类型,能消除很多情况下的装箱和拆箱处理。3.2 日常使用的简单泛型3.2.1通过例子来学习: 泛型字典 class Dictiona...
svn up --set-depth exclude dir2http://stackoverflow.com/questions/1439176/svn-can-you-remove-directories-from-a-local-checkout-only-not-from-the-repos...
分类:
其他好文 时间:
2015-07-16 11:17:09
阅读次数:
146
1、要使粒子渲染在两张图片中间,必须将两个图片的渲染批分开,就在同一个深度段内,假如没有其它其它图集的批渲染添加进来,图片的渲染顺序是depth顺序,但是此时粒子和图集是一个批次渲染,粒子始终在这个图集图片的上方,设置z轴也不管用。
2、当粒子和设置前置图片一起渲染时,此时z轴的必须为前置图片的一半;即前置图片z轴为-100,此时,粒子的z轴必须小于-50,如果前置图片z轴为100,则粒子z轴必...
分类:
其他好文 时间:
2015-07-15 11:21:01
阅读次数:
95
Question:Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the fa...
分类:
其他好文 时间:
2015-07-14 17:15:29
阅读次数:
106
题意:给一棵二叉树,求其深度。思路:递归比较简洁,先求左子树深度,再求右子树深度,比较其结果,返回:max_one+1。 1 /** 2 * Definition for a binary tree node. 3 * struct TreeNode { 4 * int val; 5 ...
分类:
其他好文 时间:
2015-07-11 13:25:41
阅读次数:
125
题意:二叉树最大深度思路:递归,但是不知道怎么回事直接在return里面计算总是报超时,用俩变量就可以A···奇怪,没想通代码:int maxDepth(TreeNode* root) { if(!root) return 0; int l = ma...
分类:
其他好文 时间:
2015-07-11 01:00:42
阅读次数:
110
1.问题描述与理解
深度优先搜索(Depth First Search,DFS)所遵循的策略,如同其名称所云,是在图中尽可能“更深”地进行搜索。在深度优先搜索中,对最新发现的顶点v若此顶点尚有未探索过从其出发的边就探索之。当v的所有边都被探索过,搜索“回溯”到从其出发发现顶点v的顶点。此过程继续直至发现所有从源点可达的顶点。若图中还有未发现的顶点,则以其中之一为新的源点重复搜索,直至所有的...
分类:
编程语言 时间:
2015-07-10 19:11:01
阅读次数:
129
Maximum Depth of Binary Tree (DFS, TREE)Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path fr...
分类:
其他好文 时间:
2015-07-10 13:17:22
阅读次数:
99
https://leetcode.com/problems/minimum-depth-of-binary-tree/ 1 /** 2 * Definition for a binary tree node. 3 * struct TreeNode { 4 * int val; 5 ...
分类:
其他好文 时间:
2015-07-09 12:50:40
阅读次数:
102