欢迎来到淘文阁 - 分享文档赚钱的网站! | 帮助中心 好文档才是您的得力助手!
淘文阁 - 分享文档赚钱的网站
全部分类
  • 研究报告>
  • 管理文献>
  • 标准材料>
  • 技术资料>
  • 教育专区>
  • 应用文书>
  • 生活休闲>
  • 考试试题>
  • pptx模板>
  • 工商注册>
  • 期刊短文>
  • 图片设计>
  • ImageVerifierCode 换一换

    单链表实验.pdf

    • 资源ID:56648454       资源大小:33.76KB        全文页数:7页
    • 资源格式: PDF        下载积分:4.3金币
    快捷下载 游客一键下载
    会员登录下载
    微信登录下载
    三方登录下载: 微信开放平台登录   QQ登录  
    二维码
    微信扫一扫登录
    下载资源需要4.3金币
    邮箱/手机:
    温馨提示:
    快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
    如填写123,账号就是123,密码也是123。
    支付方式: 支付宝    微信支付   
    验证码:   换一换

     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    单链表实验.pdf

    实验二单链表实验一、实验目的1、掌握用 Visual C+6.0上机调试单链表的基本方法2、掌握单链表的插入、删除、查找、求表长以及有序单链表的合并算法的实现二、实现内容1、单链表基本操作的实现 问题描述 要在带头结点的单链表h中第 i 个数据元素之前插入一个数据元素x,首先需要在单链表中寻找到第 i-1 个结点并用指针p指示,然后申请一个由指针s 指示的结点空间,并置 x为其数据域值,最后修改第i-1 个结点,并使 x结点的指针指向第i 个结点,要在带头结点的单链表h中删除第 i 个结点,首先要计数寻找到第i 个结点并使指针p指向其前驱第 i-1 个结点,然后删除第i 个结点并释放被删除结点空间。基本要求 用链式存储结构实现存储 实现提示 链式存储结构不是随机存储结构,即不能直接取到单链表中某个结点,而要从单链表的头结点开始一个一个地计数寻找。2、求表长以及有序单链表的合并算法的实现 问题描述 假设有两个按元素值递增次序排列的线性表,均以单链表形式存储。请编写算法将这两个单链表归并为一个按元素值递减次序排列的单链表,并计算表长。要求利用原来两个单链表的结点存放归并后的单链表。基本要求 用链式存储结构实现存储实验代码#include#include#define null 0/-定义节点-typedef struct List int data;struct List*next;List;/-构造链表-List*InitList(int n)int i;List*head,*p,*q;head=(List*)malloc(sizeof(List);/构造头结点 if(!head)exit(0);/判断是否成功分配内存 q=head;head-data=0;/记录链表长度 head-next=null;for(i=0;inext=head-next;head-next=p;*/-/-尾插-p-next=q-next;q-next=p;q=p;head-data+;/长度自增 printf(输入数据第%d 个数据:n,head-data);scanf(%d,&(p-data);return head;/-插入-void Insert(List*head,int position,int elem)int i;List*p,*q;if(positionhead-data+1)printf(插入位置非法!);exit(0);p=head;for(i=1;inext;q=(List*)malloc(sizeof(List);q-data=elem;q-next=p-next;p-next=q;head-data+;printf(成功将%d 插入到第%d 个位置!n,elem,position);/-删除-void Delete(List*head,int position)int i;List*p,*q;if(!head)printf(链表为空!);exit(0);p=head;q=p-next;文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码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 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4 if(positionhead-data)printf(非法位置!);exit(0);for(i=1;inext;q=p-next;p-next=q-next;printf(成功删除第%d 个位置上的元素:%dn,position,q-data);free(q);head-data-;/-排序(由小到大)-void sort(List*head)int temp;List*p,*q;for(p=head-next;(p-next)&(head-data1);p=p-next)for(q=p-next;q;q=q-next)if(q-datadata)temp=p-data;p-data=q-data;q-data=temp;/-有序合并-void Unite_List(List*head,List*nhead)int n=0;List*p,*q,*pre;sort(head);sort(nhead);pre=head;p=pre-next;q=nhead-next;while(q)文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6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next=q;head-data+=nhead-data;break;else if(q-datadata)/nhead表中当前元素小于head当前元素,插入其前面 nhead-next=q-next;/nhead链表头指针跳过 q后移nhead-data-;q-next=p;/接入后继 pre-next=q;/接入前驱head-data+;pre=q;p=pre-next;q=nhead-next;else pre=p;p=pre-next;free(nhead);/-查找位置-void Search_Position(List*head,int elem)int i,position;List*p;p=head;if(!head)printf(链表为空!);exit(0);for(i=1;idata;i+)p=p-next;if(elem=p-data)position=i;printf(发现元素%d 在表中的位置:%dn,elem,position);exit(0);文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8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7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4 printf(在表中未发现元素%dn,elem);/-查找元素-void Search_Element(List*head,int position)int i;List*p;p=head;if(!head)printf(链表为空!);exit(0);if(positionhead-data)printf(非法位置!);exit(0);for(i=1;inext;printf(第%d 个位置的元素为:%dn,position,p-data);/return p-data;/-遍历-void ShowMessage(List*head)List*p;int i;p=head;if(!head)/判空 printf(链表为空!);exit(0);for(i=0;idata;i+)if(i%5=0)printf(n);p=p-next;printf(%d,p-data);文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W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q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4 printf(n);/-求表长度-int GetLength(List*head)int length;if(!head)printf(链表为空!);exit(0);length=head-data;return length;/-销毁链表-void Destroy(List*head)int i;List*p;/if(!head)printf(链表不存在!);exit(0);/p=head-next;for(i=0;idata;i+)free(head);head=p;p=p-next;free(head);printf(成功销毁链表!n);/-主函数-void main()int length;/记录长度 List*head1,*head2;head1=InitList(7);/构造长度为 7的链表 head2=InitList(9);文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ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ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4 ShowMessage(head1);/遍历链表 length=GetLength(head1);/获取长度printf(表长为:%dn,length);Insert(head1,4,11);/插入一个元素ShowMessage(head1);/遍历链表length=GetLength(head1);/获取新长度printf(表长为:%dn,length);Search_Element(head1,3);/按位置查找元素Delete(head1,2);/删除元素length=GetLength(head1);/获取新长度printf(表长为:%dn,length);ShowMessage(head1);Search_Position(head1,6);/查找元素位置sort(head1);/对链表 head1排序printf(排序后!n);ShowMessage(head1);/输出排序后的数据 Unite_List(head1,head2);/合并printf(合并后!n);length=GetLength(head1);/获取长度printf(表长为:%dn,length);ShowMessage(head1);/显示合并后的数据Search_Position(head1,6);/查找合并后的位置Destroy(head1);/销毁链表 文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5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1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:CM8W7O6L5I9 HQ7J9J5W1V6 ZQ8H2Q4M6A4文档编码:C

    注意事项

    本文(单链表实验.pdf)为本站会员(H****o)主动上传,淘文阁 - 分享文档赚钱的网站仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知淘文阁 - 分享文档赚钱的网站(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    关于淘文阁 - 版权申诉 - 用户使用规则 - 积分规则 - 联系我们

    本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知淘文阁网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

    工信部备案号:黑ICP备15003705号 © 2020-2023 www.taowenge.com 淘文阁 

    收起
    展开