链表倒置C语言源代码

上传人:博****1 文档编号:493304300 上传时间:2023-02-26 格式:DOC 页数:2 大小:24.50KB
返回 下载 相关 举报
链表倒置C语言源代码_第1页
第1页 / 共2页
链表倒置C语言源代码_第2页
第2页 / 共2页
亲,该文档总共2页,全部预览完了,如果喜欢就下载吧!
资源描述

《链表倒置C语言源代码》由会员分享,可在线阅读,更多相关《链表倒置C语言源代码(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,&i);if(i0)puts(输入数据:);for(l-last=1;l-lastlast+)scanf(%d,&l-datal-last);l-last-;else exit(0);return l;int zheban(sql

2、 *l,int key)int low=1,high=key,mid;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(); /

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 行业资料 > 国内外标准规范

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号