#include <stdio.h>
#include "chain.h"
int main()
{
int i = 0;
ListHead* head = NULL;
head = CreateList();//创建链表
printf("Now we will Add four Nodes\n");
for(i = 1; i < 5; i++)
{
AddNodeByLoc(head, i, i);//添加链表节点
}
ViewList(head);//遍历链表
printf("Now we will Delete the third Node\n");
DelNodeByLoc(head, 3);//删除链表的第三个节点
ViewList(head);
printf("Now we will modify the third Node to 5\n");
ModNodeByLoc(head, 3, 5);//将第三个节点的信息修改为5
ViewList(head);
printf("Now we will view the second Node\n");
printf("%d\n",FindDataByLoc(head, 2));//查看第二个节点的数据
DestoryList(head);//销毁链表
}