问: 给定二叉树, 如何计算二叉树最大深度?算法描述如下:如果当前节点为空, 返回0(代表此节点下方最大节点数为0)如果当前节点不为空, 返回(其左子树和右子树下方最大节点数中的最大值+1)上述算法的精髓在于递归调用中的终止条件.代码如下: 1 /** 2 * Definition for bin....
分类:
编程语言 时间:
2014-07-22 22:58:15
阅读次数:
189
简介触发器是一种特殊类型的存储过程。触发器分为:DML( 数据操纵语言 Data Manipulation Language)触发器:数据库中表或视图的数据更改时触发,包括insert,update,delete语句DDL(数据定义语言 Data Definition Language)触发器:表或...
分类:
数据库 时间:
2014-07-19 21:29:13
阅读次数:
295
Strictly speaking, a function can only return one value, but if the value is a tuple, the effect is the same as returning multiple values. For example...
分类:
其他好文 时间:
2014-07-19 18:31:23
阅读次数:
208
A declaration makes a name known to a programm. A definition creates the assocatied entity. A variable declaration specifies the variable type and nam...
分类:
编程语言 时间:
2014-07-19 17:22:34
阅读次数:
213
A method for optimizing the throughput of TCP/IP applications by aggregating user application data and consolidating multiple TCP/IP connection stream...
分类:
Web程序 时间:
2014-07-19 17:17:57
阅读次数:
428
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2028题目大意:求最小公倍数,用辗转相除法。 1 #include 2 int main () 3 { 4 int gcd(int a,int b); 5 int a,b,n,i,c; ...
分类:
其他好文 时间:
2014-07-18 17:37:40
阅读次数:
305
使用最简单的排序方法; 1 /** 2 * Definition for an interval. 3 * public class Interval { 4 * int start; 5 * int end; 6 * Interval() { start = 0;...
分类:
其他好文 时间:
2014-07-18 10:26:09
阅读次数:
188
1.什么是aidl:aidl是 Android Interface definition language的缩写,一看就明白,它是一种android内部进程通信接口的描述语言,通过它我们可以定义进程间的通信接口
icp:interprocess communication :内部进程通信
2.既然aidl可以定义并实现进程通信,那么我们怎么使用它呢?文档/android-sdk/docs...
分类:
移动开发 时间:
2014-07-17 19:16:35
阅读次数:
272
如何在相同的页面设置多个tinymce编辑器
This example shows how to setup multiple editors on the same page and with different configs.
用于多功能文本框,之前同页面只能用一个tinymce编辑器,百度谷歌没结果,所以整理下代码,以供参考:...
分类:
其他好文 时间:
2014-07-17 17:02:09
阅读次数:
298
动态存储类
StrVec Class Design
StrVec Class Definition
class StrVec
{
public:
//构造函数
StrVec():elements(nullptr), first_free(nullptr), cap(nullptr){}
//用initializer_list初始化参数列表
StrVe...
分类:
其他好文 时间:
2014-07-17 10:22:21
阅读次数:
286