leetcode
日月之灵
这个作者很懒,什么都没留下…
展开
-
Leetcode - Populating Next Right Pointers in Each Node
Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; } Populate each next pointer to point to its next right node.原创 2014-10-16 20:08:51 · 435 阅读 · 2 评论 -
leetcode-Maximum Product Subarray
Find the contiguous subarray within an array (containing at least one number) which has the largest product. For example, given the array [2,3,-2,4], the contiguous subarray [2,3] has the largest原创 2014-10-18 22:29:26 · 441 阅读 · 0 评论 -
leetcode-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原创 2014-10-18 22:45:32 · 339 阅读 · 0 评论 -
leetcode-Populating Next Right Pointers in Each Node II
Follow up for problem "Populating Next Right Pointers in Each Node". What if the given tree could be any binary tree? Would your previous solution still work? Note: You may only use constant原创 2014-10-17 15:17:11 · 385 阅读 · 0 评论