摘要: Mergeksorted linked lists and return it as one sorted list. Analyze and describe its complexity.外部排序的基础 1 #include 2 #include 3 using namespace std; 4 5 struct ListNode { 6 int val; 7 ListNode *next; 8 ListNode(int x) : val(x), next(NULL) {} 9 };10 class Solution {11 public:12 stat... 阅读全文
posted @ 2014-03-09 18:04 青轰的后花园 阅读(119) 评论(0) 推荐(0) 编辑
摘要: Path SumGiven a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.For example:Given the below binary tree andsum = 22, 5 / \ 4 8 / / \ 11 13 4 ... 阅读全文
posted @ 2014-03-09 17:18 青轰的后花园 阅读(571) 评论(0) 推荐(0) 编辑