LeetCode --- 123. Best Time to Buy and Sell Stock III Mar 22, 2015

 Tags LeetCode , C++ , 数组 , 动态规划

题目链接:Best Time to Buy and Sell Stock IIISay you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum ... More »

0条评论

LeetCode --- 122. Best Time to Buy and Sell Stock II Mar 22, 2015

 Tags LeetCode , C++ , 数组 , 贪心

题目链接:Best Time to Buy and Sell Stock IISay you have an array for which the i-th element is the price of a given stock on day i.Design an algorithm to find the maximum ... More »

0条评论

LeetCode --- 121. Best Time to Buy and Sell Stock Mar 22, 2015

 Tags LeetCode , C++ , 数组 , 动态规划

题目链接:Best Time to Buy and Sell StockSay you have an array for which the i-th element is the price of a given stock on day i.If you were only permitted to complete at m... More »

0条评论

LeetCode --- 120. Triangle Mar 21, 2015

 Tags LeetCode , C++ , 数组 , 动态规划

题目链接:TriangleGiven a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the followi... More »

0条评论

LeetCode --- 119. Pascal's Triangle II Mar 21, 2015

 Tags LeetCode , C++ , 数组

题目链接:Pascal’s Triangle IIGiven an index k, return the kth row of the Pascal’s triangle.For example, given k = 3,Return [1,3,3,1].Note:Could you optimize your algorithm... More »

0条评论

LeetCode --- 118. Pascal's Triangle Mar 21, 2015

 Tags LeetCode , C++ , 数组

题目链接:Pascal’s TriangleGiven numRows, generate the first numRows of Pascal’s triangle.For example, given numRows = 5,Return[ [1], [1,1], [1,2,1], [1,3,3,1], [... More »

0条评论

LeetCode --- 117. Populating Next Right Pointers in Each Node II Mar 20, 2015

 Tags LeetCode , C++ , , 深度优先搜索

题目链接:Populating Next Right Pointers in Each Node IIFollow up for problem “Populating Next Right Pointers in Each Node”.What if the given tree could be any binary tree?... More »

0条评论

LeetCode --- 116. Populating Next Right Pointers in Each Node Mar 20, 2015

 Tags LeetCode , C++ , , 深度优先搜索

题目链接:Populating Next Right Pointers in Each NodeGiven a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *n... More »

0条评论

LeetCode --- 115. Distinct Subsequences Mar 19, 2015

 Tags LeetCode , C++ , 动态规划 , 字符串

题目链接:Distinct SubsequencesGiven a string S and a string T, count the number of distinct subsequences of T in S.A subsequence of a string is a new string which is forme... More »

0条评论

LeetCode --- 114. Flatten Binary Tree to Linked List Mar 19, 2015

 Tags LeetCode , C++ , , 深度优先搜索

题目链接:Flatten Binary Tree to Linked ListGiven a binary tree, flatten it to a linked list in-place.For example,Given 1 / \ 2 5 / \ \ ... More »

0条评论