1、使用双向循环链表,实现自动插入数据并且对链表进行排序。
代码如下所示:
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
//定义一个结构体
typedef struct node
{
int data;
struct node *prev;
struct node *next;
}node;
//初始化结构体
node *initialize(void)
{
node *new=malloc(sizeof(node));
if (new==NULL)
{
printf("malloc failure!");
return NULL;
}
new->data=0;
new->next=new;
new->prev=new;
return new;
}

&spm=1001.2101.3001.5002&articleId=126373681&d=1&t=3&u=ba7d7a6b3db746f2a6b350ca253e7fdf)
9171

被折叠的 条评论
为什么被折叠?



