题目:
Given a binary tree, find the maximum path sum.
The path may start and end at any node in the tree.
For example:
Given the below binary tree,
1
/ 2 3
Ret...
分类:
编程语言 时间:
2015-07-26 22:39:28
阅读次数:
189
二叉树遍历问题DescriptionTree RecoveryLittle Valentine liked playing with binary trees very much. Her favorite game was constructing randomly looking binary ...
分类:
其他好文 时间:
2015-07-26 22:24:53
阅读次数:
162
原题:DescriptionLittle Valentine liked playing with binary trees very much. Her favorite game was constructing randomly looking binary trees with capita...
分类:
其他好文 时间:
2015-07-26 20:33:31
阅读次数:
118
DescriptionLittle Valentine liked playing with binary trees very much. Her favorite game was constructing randomly looking binary trees with capital l...
分类:
其他好文 时间:
2015-07-26 20:27:27
阅读次数:
110
Lowest Common Ancestor of a Binary Tree Total Accepted: 6162 Total Submissions: 23311 My Submissions Question Solution
Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in...
分类:
其他好文 时间:
2015-07-26 19:23:17
阅读次数:
192
Kth Smallest Element in a BST
Given a binary search tree, write a function kthSmallestto find the kth
smallest element in it.
Note:
You may assume k is always valid, 1 ≤ k ≤ BST's total elem...
分类:
其他好文 时间:
2015-07-26 15:52:22
阅读次数:
125
Given a binary tree containing digits from 0-9 only, each root-to-leaf path
could represent a number.
An example is the root-to-leaf path 1->2->3 which represents the number 123.
Find the tota...
分类:
其他好文 时间:
2015-07-26 15:50:28
阅读次数:
113
Redis_DataType.htmlRedis-DataTypeRedis是一个键值对型的数据库,但是支持多种数据结构。具体如下:Binary-safe strings 意义为在进行对二进制的解码和编码时,不具有特殊字符,如转义字符,char数组中的\0,结尾加null等都不是二进制安全的。关键在...
分类:
其他好文 时间:
2015-07-26 15:31:49
阅读次数:
211
主要是如何实现在某些层的翻转,使用两个队列。记录两个层。如果需要翻转,则翻转。这里实际上有一个翻转的消耗。可以使用双端队列,在插入时就是正确的顺序,无需翻转。 1 2 3456 7level 1: 1level 2: 3 2level 3: 7 6 5 4使用flag控制读写方向即可,这样放到lis...
分类:
其他好文 时间:
2015-07-26 12:29:41
阅读次数:
115
两种思路一、level by level使用两个queue,queue1记录当前访问的层,queue2记录下一个层,最后queue1清空,queue2拷贝至queue1.二、depth first traval使用参数传递level,在适当的时刻增加层数[1]http://www.cnblogs.c...
分类:
其他好文 时间:
2015-07-26 12:27:51
阅读次数:
145