zoukankan      html  css  js  c++  java
  • [面试] [反转链表] 三变量提头法

    #include <iostream>
    #include <string>
    #include <cstring>
    #include <cstdlib>
    #include <cstdio>
    #include <cmath>
    #include <vector>
    #include <stack>
    #include <deque>
    #include <queue>
    #include <bitset>
    #include <list>
    #include <map>
    #include <set>
    #include <iterator>
    #include <algorithm>
    #include <functional>
    #include <utility>
    #include <sstream>
    #include <climits>
    #include <cassert>
    #define BUG puts("here!!!");
    
    using namespace std;
    const int N = 105;
    struct Node {
    	int num;
    	Node* next;
    };
    Node* head;
    Node* reverse(Node* head) {
    	if(head == NULL) return NULL;
    	Node* tmp = head;
    	Node*p;
    	while(tmp->next != NULL) {
    		p = tmp->next;
    		tmp->next = p->next;
    		p->next = head;
    		head = p;
    	}
    	return head;
    }
    int main() {
    	return 0;
    }
    

  • 相关阅读:
    17. 偏函数
    16. 装饰器
    vim详解
    linux用户管理sudo 磁盘分区
    linux用户管理
    linux文件与目录(四)
    linux特殊权限
    linux文件和目录(二)
    linux文件和目录
    配置网络
  • 原文地址:https://www.cnblogs.com/robbychan/p/3787154.html
Copyright © 2011-2022 走看看