Follow up for problem "Populating Next Right Pointers in Each Node".
What if the given tree could be any binary tree? Would your previous solution still work?
Note:
You may only use constant ...
分类:
其他好文 时间:
2015-01-04 13:37:37
阅读次数:
139
运营一个餐厅和构建一个高性能的服务器有很多相似的地方,我们一起来看看吧。
https://www.zybuluo.com/jewes/note/59732
单打独斗的单线程模式
小明的餐厅刚起步,规模很小,就只有小明一个人在忙活。当客人到来的时候,他得首先去招呼客人,等客人下单,然后去后厨炒菜,然后再把饭菜端给客人。如果在这个过程中有新的客人到来,他是没有功夫去招呼新客人,新客人就只能在...
分类:
其他好文 时间:
2015-01-04 00:01:28
阅读次数:
436
Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST.
Calling next() will return the next smallest number in the BST.
Note: next()...
分类:
其他好文 时间:
2015-01-03 22:26:17
阅读次数:
219
QUESTIONGiven an integer n, return the number of trailing zeroes in n!.Note: Your solution should be in logarithmic time complexity.FIRST TRYclass Sol...
分类:
其他好文 时间:
2015-01-03 19:49:18
阅读次数:
178
Construct Binary Tree from Inorder and Postorder TraversalGiven inorder and postorder traversal of a tree, construct the binary tree.Note:You may assu...
分类:
其他好文 时间:
2015-01-03 17:18:44
阅读次数:
136
Construct Binary Tree from Preorder and Inorder TraversalGiven preorder and inorder traversal of a tree, construct the binary tree.Note:You may assume...
分类:
其他好文 时间:
2015-01-03 00:53:53
阅读次数:
235
Given an integer n, return the number of trailing zeroes in n!.
Note: Your solution should be in logarithmic time complexity.
解析:
只有2和5相乘才会出现0,其中整十也可以看做是2和5相乘的结果,所以,可以在n之前看看有多少个2以及多少个5就行了,又发现2的数量...
分类:
其他好文 时间:
2015-01-02 22:28:57
阅读次数:
213
Two elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.Note:A solution using O(n) space is ...
分类:
其他好文 时间:
2015-01-02 21:07:27
阅读次数:
155
Two elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.Note:A solution using O(n) space is ...
分类:
其他好文 时间:
2015-01-02 21:01:15
阅读次数:
184
http://www.tutorialspoint.com/soap/index.htmhttp://www.w3.org/TR/2000/NOTE-SOAP-20000508/SOAP协议规范介绍
分类:
其他好文 时间:
2015-01-02 17:22:17
阅读次数:
130