算法与数据结构实验 14计统一 1413101001 王成

2026/4/26 21:35:52

金陵科技学院实验报告

} main() {

int i,k; chuan *head; head=setup(s);

printf(\请输入要删除字符的位置i\\n\); scanf(\,&i);

printf(\请输入要删除字符的个数k\\n\); scanf(\,&k); delet(head,i,k); display(head); free(head); free(s); }

}

printf(\,p->c); while(p->next!=NULL) { }

p=p->next;

printf(\,p->c);

2.

#include #include typedef struct chuanlian {

char c;

struct chuanlian *next;

}chuan; chuan *s,*t;

chuan *setup(chuan *chu) {

chuan *head=NULL; chuan *rear=NULL;

金陵科技学院实验报告

char ch;

printf(\请输入字符ch直到$\\n\ch=getchar(); while(ch!='$') {

chu=malloc(sizeof(chuan)); }

void insert(chuan *s1,chuan *s2,char x) {

chuan *p; chuan *q; p=s1; if(s1==NULL) {

printf(\是空串\\n\exit(0); chu->c=ch; if(head==NULL) {

head=chu;

} else

rear->next=chu; rear=chu;

ch=getchar(); }

if(rear!=NULL)

rear->next=NULL;

return head;

金陵科技学院实验报告

}

} { }

while(p->next!=NULL) { }

if(p->next==NULL)

p->next=s2; if(p->c==x)

break;

printf(\是空串\\n\exit(0); if(s2==NULL)

p=p->next;

else { }

q=s2;

while(q->next!=NULL)

q=q->next;

q->next=p->next; p->next=s2;

void display(chuan *chu) {

chuan *p;

p=chu; if(chu==NULL) {

金陵科技学院实验报告

}

}

printf(\空串\\n\exit(0);

printf(\while(p->next!=NULL) { }

p=p->next; printf(\

main() {

char x,c;

printf(\建立单链串t\\n\t=setup(t);

c=getchar();

printf(\建立单链串s\\n\s=setup(s);

c=getchar();

printf(\请输入要在什么字符后插入\\n\

x=getchar(); }

insert(t,s,x); display(t);

四、实验结果与分析(程序运行结果及其分析)


算法与数据结构实验 14计统一 1413101001 王成.doc 将本文的Word文档下载到电脑
搜索更多关于: 算法与数据结构实验 14计统一 1413101001 的文档
相关推荐
相关阅读
× 游客快捷下载通道(下载后可以自由复制和排版)

下载本文档需要支付 10

支付方式:

开通VIP包月会员 特价:29元/月

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:xuecool-com QQ:370150219