https://oj.leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/http://blog.csdn.net/linhuanmars/article/details/23164149publicclassSolution{
publicintmaxProfit(int[]prices){
//Ifasmanytransactions
//Gready
intpro=0;
intbuy=0;
booleanhold=false;
int..
分类:
其他好文 时间:
2015-01-06 18:13:23
阅读次数:
132
https://oj.leetcode.com/problems/best-time-to-buy-and-sell-stock/http://blog.csdn.net/linhuanmars/article/details/23162793publicclassSolution{
publicintmaxProfit(int[]prices)
{
//SolutionA:
returnmaxProfit_DP(prices);
//SolutionB:
//returnmaxProfit_Binary(..
分类:
其他好文 时间:
2015-01-06 18:11:55
阅读次数:
176
https://oj.leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/http://blog.csdn.net/linhuanmars/article/details/24389549/**
*Definitionforbinarytree
*publicclassTreeNode{
*intval;
*TreeNodeleft;
*TreeNoderight;
*TreeNode(intx){va..
分类:
其他好文 时间:
2015-01-06 15:55:10
阅读次数:
101
https://oj.leetcode.com/problems/construct-binary-tree-from-inorder-and-postorder-traversal/http://blog.csdn.net/linhuanmars/article/details/24390157/**
*Definitionforbinarytree
*publicclassTreeNode{
*intval;
*TreeNodeleft;
*TreeNoderight;
*TreeNode(intx){v..
分类:
其他好文 时间:
2015-01-06 15:54:59
阅读次数:
138
https://oj.leetcode.com/problems/binary-tree-level-order-traversal-ii/http://blog.csdn.net/linhuanmars/article/details/23414711/**
*Definitionforbinarytree
*publicclassTreeNode{
*intval;
*TreeNodeleft;
*TreeNoderight;
*TreeNode(intx){val=x;}
*}
*/
publiccla..
分类:
其他好文 时间:
2015-01-06 15:49:37
阅读次数:
96
https://oj.leetcode.com/problems/minimum-depth-of-binary-tree/http://blog.csdn.net/linhuanmars/article/details/19660209/**
*Definitionforbinarytree
*publicclassTreeNode{
*intval;
*TreeNodeleft;
*TreeNoderight;
*TreeNode(intx){val=x;}
*}
*/
publicclassSoluti..
分类:
其他好文 时间:
2015-01-06 15:47:12
阅读次数:
118
https://oj.leetcode.com/problems/balanced-binary-tree/http://blog.csdn.net/linhuanmars/article/details/23731355/**
*Definitionforbinarytree
*publicclassTreeNode{
*intval;
*TreeNodeleft;
*TreeNoderight;
*TreeNode(intx){val=x;}
*}
*/
publicclassSolution{
publ..
分类:
其他好文 时间:
2015-01-06 15:46:32
阅读次数:
125
https://oj.leetcode.com/problems/path-sum/http://blog.csdn.net/linhuanmars/article/details/23654413/**
*Definitionforbinarytree
*publicclassTreeNode{
*intval;
*TreeNodeleft;
*TreeNoderight;
*TreeNode(intx){val=x;}
*}
*/
publicclassSolution{
publicbooleanhas..
分类:
其他好文 时间:
2015-01-06 15:45:33
阅读次数:
137
https://oj.leetcode.com/problems/same-tree/http://blog.csdn.net/linhuanmars/article/details/22839819/**
*Definitionforbinarytree
*publicclassTreeNode{
*intval;
*TreeNodeleft;
*TreeNoderight;
*TreeNode(intx){val=x;}
*}
*/
publicclassSolution{
publicbooleanis..
分类:
其他好文 时间:
2015-01-06 12:10:11
阅读次数:
135
https://oj.leetcode.com/problems/scramble-string/http://blog.csdn.net/linhuanmars/article/details/24506703publicclassSolution{
publicbooleanisScramble(Strings1,Strings2)
{
if(s1==null||s2==null||s1.length()!=s2.length())
returnfalse;
if(s1.isEmpty()&&am..
分类:
其他好文 时间:
2015-01-06 12:09:05
阅读次数:
134