[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 stil... 阅读全文
posted @ 2012-12-30 12:33 小刀初试 阅读(121) 评论(0) 推荐(0)

[LeetCode] Populating Next Right Pointers in Each Node 解题报告

摘要: Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; }Populate each next pointe... 阅读全文
posted @ 2012-12-30 09:27 小刀初试 阅读(159) 评论(0) 推荐(0)

[LeetCode] Plus One 解题报告

摘要: Given a number represented as an array of digits, plus one to the number.» Solve this problem[解题思路]加位与进位。模拟。[Code]1: vector plusOne(vector &digits) {... 阅读全文
posted @ 2012-12-30 08:23 小刀初试 阅读(125) 评论(0) 推荐(0)

[LeetCode] Permutations II 解题报告

摘要: Given a collection of numbers that might contain duplicates, return all possible unique permutations.For example,[1,1,2] have the following unique per... 阅读全文
posted @ 2012-12-30 06:35 小刀初试 阅读(131) 评论(0) 推荐(0)

[LeetCode] Permutations 解题报告

摘要: Given a collection of numbers, return all possible permutations.For example,[1,2,3] have the following permutations:[1,2,3], [1,3,2], [2,1,3], [2,3,1]... 阅读全文
posted @ 2012-12-30 05:32 小刀初试 阅读(146) 评论(0) 推荐(0)

[LeetCode] Path Sum II 解题报告

摘要: Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.For example:Given the below binary tree and sum ... 阅读全文
posted @ 2012-12-30 04:55 小刀初试 阅读(155) 评论(0) 推荐(0)
点击右上角即可分享
微信分享提示