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
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
This is sth. for me to learn..https://github.com/kamyu104/LintCode/blob/master/C++/expression-evaluation.cpp
分类:
其他好文 时间:
2015-10-06 15:22:55
阅读次数:
605
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
Idea is the same: climbing up the hill along one edge (Greedy)! Visualize it in your mind!class Solution {public: /** * @param A: An integer ma...
分类:
其他好文 时间:
2015-10-06 08:05:31
阅读次数:
150
Given a permutation which contains no repeated number, find its index in all the permutations of these numbers, which are ordered in lexicographical o...
分类:
其他好文 时间:
2015-10-05 14:15:28
阅读次数:
149
Not hard to find a solution, but there are several corner cases.class Solution {public: /** * @param root: The root of the binary search tree. ...
分类:
其他好文 时间:
2015-10-05 07:02:21
阅读次数:
259
Greedy: remove earliest down-edge: like "54", "97".class Solution {public: /** *@param A: A positive integer which has N digits, A is a string....
分类:
其他好文 时间:
2015-10-05 01:55:06
阅读次数:
215