c单链表逆置
来源:互联网 发布:mariadb mysql 对比 编辑:程序博客网 时间:2024/06/16 01:09
#include<stdio.h>typedef struct node{ int data; struct node *next;}node,*nodep;nodep createNode(){ int i,j; nodep t,q; nodep head=(nodep) malloc(sizeof(node)); head->next=NULL; printf("请输入节点,以0结束\n"); scanf("%d",&i); while(i!=0){ t= (nodep) malloc(sizeof(node)); t->data=i; t->next=head->next; head->next=t; scanf("%d",&i); }return head;}void printNode(nodep head){ nodep t=head->next; while(t){ printf("%d\n",t->data); t=t->next; }}void reverseNode(nodep head){ nodep cur=head->next; nodep reHead=NULL; while(cur!=NULL){ nodep preCur=cur; cur=cur->next; preCur->next=reHead; reHead=preCur; } head->next=reHead;}main(){ nodep head=createNode(); printNode(head); reverseNode(head); printNode(head);}
0 0
- 单链表逆置(C++)
- c单链表逆置
- 单链表逆置算法(c++)
- C语言单链表逆置
- C语言单链表逆置
- 单链表逆置实现(C++)
- c
- c
- c
- c
- C
- c
- c
- c
- C+
- c
- C
- c
- A View Controller Instantiation
- 番茄当下之作——莽荒纪
- 关于内存的一些问题
- c++函数参数类型-引用
- Qt-4.8 WebKit + QtWebKit-2.3.x上CSS3 Web Fonts支持的一些记录
- c单链表逆置
- 【构造】 Codeforces 476D Dreamoon and Sets
- 《算法竞赛入门经典(第2版)》代码 Chapter 2
- mount过程分析之三(do_mount -> do_new_mount)
- 静态库的生成
- 关于sda与hda
- HTML中实现两个列,每个列都固定宽度高度占满整个屏幕。如果内容多就出现滚动条!
- 热烈祝贺Polymer中文组织网站上线
- NYOJ正三角形外接圆面积