收藏 分享(赏)

链表倒置C语言源代码.doc

上传人:hyngb9260 文档编号:6137954 上传时间:2019-03-30 格式:DOC 页数:2 大小:35.50KB
下载 相关 举报
链表倒置C语言源代码.doc_第1页
第1页 / 共2页
链表倒置C语言源代码.doc_第2页
第2页 / 共2页
亲,该文档总共2页,全部预览完了,如果喜欢就下载吧!
资源描述

1、#include#include#define maxlen 100typedef structint datamaxlen;int last;sql;sql * sqlset()int i;sql *l;l=(sql*)malloc(sizeof(sql);l-last=-1;puts(“输入表长: “);scanf(“%d“,if(i0)puts(“输入数据 :“);for(l-last=1;l-lastlast+)scanf(“%d“,l-last-;else exit(0);return l;int zheban(sql *l,int key)int low=1,high=key,mi

2、d;while(lowdatamid=l-data0)return mid;if(l-datamidl-data0)high=mid-1;if(l-datamiddata0)low=mid+1;return high+1;void main()sql* l;int i,j,charu;l=sqlset();for(i=2;ilast+1;i+)l-data0=l-datai;charu=zheban(l,i);for(j=i-1;j=charu;j-)l-dataj+1=l-dataj;l-datacharu=l-data0;puts(“排序后的数据 :“);for(i=1;ilast+1;i+)printf(“%d “,l-datai);puts(“);

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 实用文档 > 统计图表

本站链接:文库   一言   我酷   合作


客服QQ:2549714901微博号:道客多多官方知乎号:道客多多

经营许可证编号: 粤ICP备2021046453号世界地图

道客多多©版权所有2020-2025营业执照举报