题目
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 leaf node.
解答
求二叉树的最大深度。
递归:a.若二叉树为空,...
分类:
其他好文 时间:
2014-12-20 15:38:37
阅读次数:
173
解题思路:先注意到序列和串的区别,序列不需要连续,而串是需要连续的,先由样例abcfbc abfcab画一个表格分析,用dp[i][j]储存当比较到s1[i],s2[j]时最长公共子序列的长度 a b f c a b 0 0 0 0 0 0 0a 0 1 1 1 1 1 1b 0 1 2 2 2 2...
分类:
其他好文 时间:
2014-12-20 08:13:50
阅读次数:
187
class Solution {public: int maxPathSum(TreeNode *root) { if(root == NULL) return 0; int max_sum = INT_MIN; unordered_map node_...
分类:
其他好文 时间:
2014-12-19 21:53:01
阅读次数:
201
Common Subsequence
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 24493 Accepted Submission(s): 10826
Problem Description
A sub...
分类:
其他好文 时间:
2014-12-19 13:08:06
阅读次数:
255
传统代理需要手动设置代理服务器的地址和端口,然后使用代理服务器访问网络配置squid.conf主要配置如下
http_port3128//用于指定代理服务器监听的地址和端口
cache_mem64MB//指定缓存功能使用的内存空间,建议为实际物理内存的1/4
maximum_object_size4096KB//允许保存到缓存空..
分类:
其他好文 时间:
2014-12-19 02:00:40
阅读次数:
516
Binary Tree Maximum Path SumGiven a binary tree, find the maximum path sum.The path may start and end at any node in the tree.For example:Given the be...
分类:
其他好文 时间:
2014-12-18 23:37:42
阅读次数:
417
这是一道神奇的题目..论文里面说得不清楚,其实是这样...如果一个长度为l的串重复多次,那么至少s[1],s[l+1],s[2*l+1],..之中有相邻2个相等...设这时为j=i*l+1,k=j+l,我们这时候借助SA和RMQ O(1)求出:m=lcp(j,k),这时候,重复次数至少ans=m ....
分类:
其他好文 时间:
2014-12-18 22:15:30
阅读次数:
171
width - viewport的宽度 height - viewport的高度initial-scale - 初始的缩放比例minimum-scale - 允许用户缩放到的最小比例maximum-scale - 允许用户缩放到的最大比例user-scalable - 用户是否可以手动缩放
分类:
移动开发 时间:
2014-12-18 21:52:54
阅读次数:
408
题目Maximum Depth of Binary Tree通过率44.2%难度EasyGiven a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest pat...
分类:
其他好文 时间:
2014-12-18 20:28:05
阅读次数:
214
标题:Maximum Depth of Binary Tree通过率:44.2%难度:简单Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest pa...
分类:
其他好文 时间:
2014-12-18 15:05:18
阅读次数:
153