《c语言双向循环链表》由会员分享,可在线阅读,更多相关《c语言双向循环链表(2页珍藏版)》请在人人文库网上搜索。
1、双向循环链表:#includetypedef int elemtype;typedef struct dupnodeelemtype data;struct dupnode *next,*prior; dulinklist;dulinklist *creatlist()char ch;int x;dulinklist *head,*r,*p;p=(dulinklist*)malloc(sizeof(dulinklist);head=p;p-next=head;p-prior=p;r=p;ch=getchar();while(ch!=?)scanf(%d,&x);p=(dulinklist*)malloc(sizeof(dulinklist);p-data=x;p-prior=r;p-next=head;r-next=p;r=r-next;printf(%d,%x,%xn,x,p-prior-next,p-prior-prior);ch=getchar();return(head);void main()creatlist(。