
leetcode
qq_20777797
这个作者很懒,什么都没留下…
展开
-
leetcode206-Reverse Linked List-反转链表
非递归:function reverseList(head) { var prev = null; while (head) { var next = head.next; head.next = prev; prev = head; head = next; } return prev; } 递归:...转载 2018-02-08 21:43:49 · 286 阅读 · 0 评论 -
leetcode53-Maximum Subarray-动态规划
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,1,-5,4], the contiguous subarray [4,-1,2,1] ha转载 2018-02-07 10:02:02 · 237 阅读 · 0 评论