云题海 - 专业文章范例文档资料分享平台

当前位置:首页 > 算法与数据结构实验 14计统一 1413101001 王成

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

  • 62 次阅读
  • 3 次下载
  • 2025/5/26 5:26:32

金陵科技学院实验报告

} 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);

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

  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

金陵科技学院实验报告 } 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 type

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:10 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219
Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com