第一种思路是用一个vector存所有的Node*
之后再用两个指针将链表拼接出来
    void reorderList(ListNode *head) {
        vector content;
        ListNode * cur = head;
        while (cur)
        {
            content.push_back(cur...
                            
                            
                                分类:
其他好文   时间:
2014-10-08 03:15:24   
                                阅读次数:
277
                             
                         
                    
                        
                            
                            
                                代码: #include?<stdio.h>
#include?<stdlib.h>
#include?<stdbool.h>
//?C语言保证逻辑表达式是从左至右求值
int?main(void)?{
	//?printf("Left")?==?4
	//?printf("Right")?==?5
	if?(!pri...
                            
                            
                                分类:
其他好文   时间:
2014-10-08 02:59:54   
                                阅读次数:
222
                             
                         
                    
                        
                            
                            
                                不废话,直接上代码: 1 /* 2 * 按照一位数,两位数,和三位数将数组中的元素分成三类, 3 * 并按照1位2位3位的顺序排列 4 */ 5 6 # include 7 # include 8 # include 9 # include 10 11 void sort2three(...
                            
                            
                                分类:
其他好文   时间:
2014-10-08 02:02:14   
                                阅读次数:
321
                             
                         
                    
                        
                            
                            
                                1 #include 2 3 int square137(int n); 4 5 void p137() { 6 double x = 3.0; 7 int y = (int)x; 8 printf("Square of %f is %d\n", x, square1...
                            
                            
                                分类:
其他好文   时间:
2014-10-08 01:41:54   
                                阅读次数:
175
                             
                         
                    
                        
                            
                            
                                头文件:
#include
using namespace std;
template
class hash_set
{
private:
	hash_type array[100000];
	int hash_fun(hash_type original);
public:
	hash_set();//构造函数
	void insert(hash_type value);//插入一个元素
	v...
                            
                            
                                分类:
编程语言   时间:
2014-10-08 00:36:14   
                                阅读次数:
349
                             
                         
                    
                        
                            
                            
                                最简单的排序算法——冒泡排序: 1 void bubble_sort(int *arr, int len) 2 { 3 int up, down; 4 for(up = 0; up != len; ++ up) 5 { 6 for(down = 0; down != ...
                            
                            
                                分类:
其他好文   时间:
2014-10-07 23:58:24   
                                阅读次数:
339
                             
                         
                    
                        
                            
                            
                                static void Main(string[] args) {Int32 i = 10; object obj = new object(); //装箱操作,通常没有异常 try { ...
                            
                            
                                分类:
其他好文   时间:
2014-10-07 20:48:54   
                                阅读次数:
146
                             
                         
                    
                        
                            
                            
                                代码: #include?<stdio.h>
#include?<stdlib.h>
//?标准C风格使用前向声明(forward?declaration)
//?函数funcA使用前向声明
//?函数funcB未使用前向声明
//?声明函数
void?funcA(void);
//?声明并...
                            
                            
                                分类:
其他好文   时间:
2014-10-07 20:26:14   
                                阅读次数:
190
                             
                         
                    
                        
                            
                            
                                /* *开发人员:此名字已打上马赛克 *日期:2014年9月29日 *意义:走向IT界,人生第一个程序。 */ public class HelloWorld{ public static void main(String[] args){ //输出信...
                            
                            
                                分类:
其他好文   时间:
2014-10-07 19:53:24   
                                阅读次数:
282
                             
                         
                    
                        
                            
                            
                                我在gridview1 《编辑列》里面添加了一个《CommandField 删除》的控件,之后在gridview1的事件《RowDeleting》事件下 写了一段删除行的 代码:protected void GridView1_RowDeleting(object sender, GridViewD...
                            
                            
                                分类:
其他好文   时间:
2014-10-07 19:03:23   
                                阅读次数:
139