链表的归并排序
特别注意取中值函数的书写
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
...
分类:
其他好文 时间:
2015-03-30 21:15:46
阅读次数:
172
add by zhj: 在Python文档中清楚的说明了默认参数是怎么工作的,如下"Default parameter values are evaluated when the function definition is executed.This means that the expressi...
分类:
编程语言 时间:
2015-03-30 18:23:23
阅读次数:
182
题意:链表大数的加法处理,不过链表上的数是反序的。本题来源:https://leetcode.com/problems/add-two-numbers/分析:1.如果其中链表为空,则不用计算了;如果两个链表都为空,则返回空(链表不熟)。 1 /** 2 * Definition for singl....
分类:
其他好文 时间:
2015-03-30 12:57:04
阅读次数:
101
练习3-77原文Exercise 3.77. The integral procedure used above was analogous to the “implicit” definition of the infinite stream of integers in section 3.5.2. Alternatively, we can give a definition of inte...
分类:
其他好文 时间:
2015-03-29 13:45:57
阅读次数:
101
Given a collection of intervals, merge all overlapping intervals.
For example,
Given [1,3],[2,6],[8,10],[15,18],
return [1,6],[8,10],[15,18].
/**
* Definition for an interval.
* struct In...
分类:
其他好文 时间:
2015-03-28 15:51:02
阅读次数:
135
Html语言基础1.HTML编辑软件Microsoft Virsual Studio.NET2.文档类型定义(Document Type Definition,DTD)格式(1)HTML指文档定义类型(2)PUBLIC指DTD文档对任何人公开访问,而不是某个公司的内部规范文件。(3)version ...
分类:
编程语言 时间:
2015-03-27 23:50:49
阅读次数:
143
I am lazy so I did not clear the two dynamic allowcated . 1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * int val; 5 * ...
分类:
其他好文 时间:
2015-03-21 18:33:56
阅读次数:
163
Recursive. 1 /** 2 * Definition for binary tree 3 * struct TreeNode { 4 * int val; 5 * TreeNode *left; 6 * TreeNode *right; 7 * ...
分类:
其他好文 时间:
2015-03-21 18:32:35
阅读次数:
129
Same with I 1 /** 2 * Definition for binary tree 3 * struct TreeNode { 4 * int val; 5 * TreeNode *left; 6 * TreeNode *right; 7 * ...
分类:
其他好文 时间:
2015-03-21 18:25:44
阅读次数:
148
Iterative: 1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * int val; 5 * ListNode *next; 6 * ListNode(int x) : ...
分类:
其他好文 时间:
2015-03-21 08:37:15
阅读次数:
117