Makefile 的使用
双向链表
typedef struct person
{
char name[32];
int age;
char sex;
int score;
} DATATYPE;
typedef struct dounode
{
DATATYPE data;
struct dounode *prev;
struct dounode *next; // 多了一个向前的指针
} DouLinkNode;
typedef struct list
{
DouLinkNode *head;
int clen;
} DouLinkList;
typedef enum
{
DIR_FORWARD,
DIR_BACKWARD
} DIRECT;
概念图:
函数基本类型: 
DouLinkList *CreateDouLinkList()
{
}
头插函数
int InsertHeadDouLinkList(DouLinkList *dl, DATATYPE *data)

bash
int InsertHeadDouLinkList(DouLinkList *dl, DATATYPE *data)
{
DouLinkNode *newnode = malloc(sizeof(DouLinkNode));
if (NULL == newnode)
{
printf("error");
DouLinkNode *next = NULL;
DouLinkNode *prev = NULL;
if (!IsEmptyDouLinkList(dl))
{
newnode->next = dl->head; // 新的指向头节点
dl->head->prev = newnode; // 头节点的前一个指向新节点的本身。
}
dl->head = newnode; // 如果为空的时候,头节点指向新的节点,也就实现了插入头节点的概念。
dl->clen++;
return 0;
}
}
int ShowDouLinkList(DouLinkList *dl, DIRECT dir)
cpp
int ShowDouLinkList(DouLinkList *dl, DIRECT dir)
{
DouLinkNode *tmp = dl->head;
if (DIR_FORWARD == dir) // 判断遍历方向是否为正向
{
while (tmp) //
{
printf("%s %d %c %d", tmp->data.name, tmp->data.age, tmp->data.sex, tmp->data.score);
tmp = tmp->next; // 向后移动一个节点,(最终的顺序和插入的顺序是相反的)
}
}
else
{
while (tmp->next)
{
tmp = tmp->next; // 循环到这里之后 ,tmp 已经指向最后一个节点。
}
while (tmp) //
{
printf("%s %d %c %d", tmp->data.name, tmp->data.age, tmp->data.sex, tmp->data.score);
tmp = tmp->prev; //开始到推,从末尾到头进行输出。
}
}
return 0;
}
int InserTailDouLinkList(DouLinkList *dl, DATATYPE *data)
{
}
DouLinkNode *FindDouLinkList(DouLinkList *dl, char *name)
{
}
int ModifyDouLinkList(DouLinkList *dl, char *name, DATATYPE *newdata)
{
}
int DeleteDouLinkList(DouLinkList *dl, char *name)
{

}
int IsEmptyDouLinkList(DouLinkList *dl)
{
}
int GetSizeDouLinkList(DouLinkList *dl)
{
}
int DestroyDouLinkList(DouLinkList *dl)
{
}

