菱纱梦

导航

2014年9月7日 #

Binary Tree Postorder Traversal <leetcode>

摘要: Given a binary tree, return thepostordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[3,2,1].No... 阅读全文

posted @ 2014-09-07 14:08 菱纱梦 阅读(176) 评论(0) 推荐(0) 编辑

Best Time to Buy and Sell Stock III <leetcode>

摘要: Say you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the maximum profit. You may complete a... 阅读全文

posted @ 2014-09-07 13:21 菱纱梦 阅读(139) 评论(0) 推荐(0) 编辑

Best Time to Buy and Sell Stock <leetcode>

摘要: Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one transaction 阅读全文

posted @ 2014-09-07 12:26 菱纱梦 阅读(178) 评论(0) 推荐(0) 编辑

Search a 2D Matrix <leetcode>

摘要: Write an efficient algorithm that searches for a value in anmxnmatrix. This matrix has the following properties:Integers in each row are sorted from l... 阅读全文

posted @ 2014-09-07 10:32 菱纱梦 阅读(153) 评论(0) 推荐(0) 编辑

Minimum Path Sum <leetcode>

摘要: Given amxngrid filled with non-negative numbers, find a path from top left to bottom right whichminimizesthe sum of all numbers along its path.Note:Yo... 阅读全文

posted @ 2014-09-07 10:14 菱纱梦 阅读(158) 评论(0) 推荐(0) 编辑