#include "stdio.h"
typedef int ElemType;
typedef struct Node /*单链表结点*/
{
ElemType data; /*数据域*/
struct Node *next; /*指针域*/
}Node;
void main()
{
Node *newlist();
Node *dellist(Node *,ElemType *e);
Node *m,*k,*e,*h;
clrscr();
h=newlist();
m=h;
printf("The old list:");
while(m->next!=h)
{
printf("%2d",m->next->data);
m=m->next;
}
printf("\n");
k=dellist(h,e);
printf("The new list:");
while(k->next!=h)
{
printf("%3d",k->next->data);
k=k->next;
}
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余2页未读,立即下载