链表
c实现的结构
kayshi2018
这个作者很懒,什么都没留下…
展开
-
Linux中的list使用
1:使用说明在linux下有一种常用的链表结构。当你需要很多相同结构体,并想把它们连接在一起。方便你增减或者逐个访问的时候,可以用这种结构。当然你也可以直接用链表指针,那么你就必须自己写,初始化链表,添加和删除,循环访问等函数。如果直接用list,就是直接把struct list_head放在你的结构体里。然后包含一个头文件list.h。就可以直接使用现成的链表操作的各种函数(创建, 增加, 删除和遍历)。z2:常用函数2.1 list_headstruct list_head { stru原创 2020-11-23 16:20:47 · 6052 阅读 · 0 评论 -
双向循环链表示例
双向循环链表的各种操作相对于单链表多了一个指针prev指向全面的节点#include<stdio.h>#include<stdlib.h>typedef struct student{ int socre; struct student *prev; struct student *next;} LinkList;...原创 2020-04-16 14:30:06 · 142 阅读 · 0 评论 -
单链表
1 #include<stdio.h> 2 #include<stdlib.h> 3 /*定义链表结构体*/ 4 typedef struct student{ 5 int socre; 6 struct student *next; 7 } LinkList; 8 /*创建n个节点的链表,实际有n+1个元素,...原创 2019-09-18 18:38:39 · 269 阅读 · 0 评论