C语言--链表
文章平均质量分 72
huangziyun
这个作者很懒,什么都没留下…
展开
-
基本链表的创建,结点插入、删除
#include #include typedef struct llist{ int data; struct llist *next; }node,*link; //输出链表 void printlist(link head) { link ptr; ptr=head->next; while(ptr!=NULL) { printf("%d ",p原创 2012-04-24 14:55:06 · 325 阅读 · 0 评论 -
基本链表的逆转
思路:遍历一遍链表,利用一个辅助指针,存储遍历过程中当前指针指向的下一个元素,然后将当前节点元素 的指针翻转后,利用已经存储的指针往后面继续遍历。 ------------------------------------------------------------------------------ #include #include typedef s原创 2012-04-24 21:14:29 · 243 阅读 · 0 评论 -
单链表创建,排序,按序插入
#include #include typedef struct list{ int data; struct list *next; }node,*link; link create_list()//创建单链表 { link head,ptr,ptr1; int value; head=(link)malloc(sizeof(node)); if(!head原创 2012-04-28 11:01:21 · 528 阅读 · 0 评论