摘要:
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... 阅读全文
摘要:
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 ... 阅读全文