摘要: 1 ListNode* ReverseList(ListNode *p) { 2 if (p == NULL || p->next == NULL) 3 return p; 4 5 ListNode *pre = NULL; 6 ListNode *nex... 阅读全文
posted @ 2015-07-25 18:14 QingLiXueShi 阅读(205) 评论(0) 推荐(0) 编辑
摘要: 解法一:递归 1 TreeNode* lowestCommonAncestor(TreeNode* root, TreeNode* p, TreeNode* q) 2 { 3 if (root == NULL || p == NULL || q == NULL) 4 retu... 阅读全文
posted @ 2015-07-25 16:38 QingLiXueShi 阅读(201) 评论(0) 推荐(0) 编辑