1.构建双向循环链表的数据结构:
#include
#include
#include
#define LEN sizeof(struct long_int)
struct long_int
{
int data;
int over;
struct long_int *pro;
struct long_int *next;
};
2.完成该功能所使用的各个算法:
struct long_int *creat()
{
struct
long_int *head;
head=(struct long_int *)malloc(LEN);
if(head==NULL)
printf("malloc error!\n");
else
{
head->data=0;
head->over=0;
head->pro=head;
head->next=head;
}
return(head);
}
void print(struct long_int *head)
{
struct
long_int *p;
p=head;
if(head->next==head)
printf("longint error!\n");
else
{
if(head->data==-1)
printf("-");
p=head->next;
<