/** * Definition for binary tree * struct
TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) :
val(x), left(...
分类:
其他好文 时间:
2014-07-22 23:07:34
阅读次数:
312
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...
分类:
其他好文 时间:
2014-07-22 23:07:13
阅读次数:
379
这道题需要注意的地方有以下一些:1.
求从子树中的某节点到当前节点的最大路径不能采用递归方法,因为这个部分会被反复的调用,如果用递归,会使得之前已经计算过的节点被重复计算,使得时间复杂度特别高;2.
树中有节点的值是负数的。下面是AC代码。(我发现AC并不代表代码真的完全正确!!) 1 /** 2 ...
分类:
其他好文 时间:
2014-05-01 12:10:52
阅读次数:
274
MaximumTime Limit:3000MSMemory Limit:0KB64bit IO
Format:%lld & %lluSubmitStatusDescriptionLetx1,x2,...,xmbe real numbers
satisfying the following cond...
分类:
其他好文 时间:
2014-05-01 01:13:54
阅读次数:
415
http://blog.csdn.net/uestc_huan/article/details/39659233次握手,4次分手2MSL等待状态:每个具体TCP实现必须选择一个报文段最大生存时间MSL(maximum
segment lifetime),它是任何报文段被丢弃前在网络内的最长时间。这个...
分类:
其他好文 时间:
2014-04-29 17:15:30
阅读次数:
416
2014-04-28 23:35题目:最大子数组和问题。解法:O(n)解法。代码: 1 //
17.8 Find the consecutive subarray with maximum sum in an array. 2 // O(n)
online algorithm. 3 #include...
分类:
其他好文 时间:
2014-04-29 16:35:28
阅读次数:
429
栈耗尽,递归会导致该问题。****** B A T C H R E C U R S I O N
exceeds STACK limits ******Recursion Count=1240, Stack Usage=90 percent****** B
A T C H PROCESS...
分类:
其他好文 时间:
2014-04-28 05:04:48
阅读次数:
409