积少成多

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

2016年6月28日

摘要: Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example, given the array [−2,1,−3,4,−1,2, 阅读全文
posted @ 2016-06-28 22:07 x7b5g 阅读(156) 评论(0) 推荐(0) 编辑

摘要: Say 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 profit. You may comple 阅读全文
posted @ 2016-06-28 22:01 x7b5g 阅读(124) 评论(0) 推荐(0) 编辑

摘要: 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 @ 2016-06-28 21:49 x7b5g 阅读(194) 评论(0) 推荐(0) 编辑

摘要: Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST. According to the definition of LCA on Wikipedia 阅读全文
posted @ 2016-06-28 17:25 x7b5g 阅读(213) 评论(0) 推荐(0) 编辑