Binary search. Please not data types and some details.class Solution {public: /** *@param L: Given n pieces of wood with length L[i] *@para...
分类:
其他好文 时间:
2015-10-07 12:12:05
阅读次数:
184
(referrence: cmu_binary_heap)DefinitionA binary heap is a complete binary tree arranged in heap ordering property.There are two types of ordering:1. m...
分类:
其他好文 时间:
2015-10-07 06:21:42
阅读次数:
283
Complete Binary TreeAccording to wiki,A complete binary tree is a binary tree in which every level, except possibly the last, is completely filled, an...
分类:
其他好文 时间:
2015-10-07 06:20:24
阅读次数:
149
Inorder Successor in BSTGiven a binary search tree and a node in it, find the in-order successor of that node in the BST.ExampleGiven tree =[2,1]and n...
分类:
其他好文 时间:
2015-10-07 06:18:13
阅读次数:
171
Validate Binary Search TreeGiven a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left subtre...
分类:
其他好文 时间:
2015-10-07 00:58:16
阅读次数:
269
Invert a binary tree. 4 / \ 2 7 / \ / \1 3 6 9to 4 / \ 7 2 / \ / \9 6 3 1Trivia:This problem was inspired bythis...
分类:
其他好文 时间:
2015-10-06 19:28:00
阅读次数:
117
Mac OS/Android在下面Static Initializer Mozillaproject师通过优化Static Initializer(静态初始化,或全局建构函数, Global Constructor)和Binary布局来提升FireFox启动速度的文章。很有參考价值。文章中以x...
分类:
其他好文 时间:
2015-10-06 13:59:57
阅读次数:
264
Balanced Binary TreeGiven a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tre...
分类:
其他好文 时间:
2015-10-06 12:49:38
阅读次数:
201
Binary Tree Inorder TraversalGiven a binary tree, return theinordertraversal of its nodes' values.ExampleGiven binary tree{1,#,2,3}, 1 \ 2 ...
分类:
其他好文 时间:
2015-10-06 11:38:28
阅读次数:
137
Time complexity O(log(n)). When the question requires O(log(n)) time complexity, we always need to think whether it can be solved by binary search.For...
分类:
其他好文 时间:
2015-10-06 07:00:43
阅读次数:
176