- 1、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
数据结构实训(Data structure training)
数据结构实训(Data structure training) # includes stdio.h # includes malloc.h # includes conio.h # define maxsize 10 extern int b3 = 0, y3 = 0; extern int b = 0, y4 = 0; typedef int keytype; typedef struct list _ info { keytype key; } elemtype; / / 直接插入排序 void insertsort (elemtype [], int n) { int i, j; int b = 0, yl = 0; for (i = 2; the = n; i + +) { to [0] = a [i]. j = i - 1. yl + +; while (a [0] to [j].key.key) { [j + 1] = a [j]. j = j - 1; b1 + +; yl + +; } yl + +; [j + 1] = a [0]. } for (i = 1, the = n; i + +) printf (% d, []); printf (\ n); printf (比较次数b1 =% d, 移动次数y1 =% d \ n, b1, yl); } / / 冒泡排序 void bubblesort3 (elemtype [], int n) { int i, j, last, flag, m, s; int b = 0, y2 = 0; last = n - 1. for (i = n; i 1; -) { flag = 0; m = last; for (j = 1; j = m; j + +) if (a [j].key [j + 1].key) { s = [j].key; [j].key = [j + 1].key; [j + 1].key = temp; flag = 1; last = j; b + +. y2 + +; } if (flag = = 0) break; } for (i = 1, the = n; i + +) printf (% d, []); printf (\ n); printf (比较次数b2 =% d, 移动次数y2 =% d \ n, b2, y2). } / / 快速排序 void quicksort (elemtype [], int from, int right) { elemtype temp. int i, j; i = left (j = right; s = a [i]. while (i j) { doc + +. while (i j temp.key = [j].key) { j -. doc + +. } in [the] = a [j].key.key; y3 + +; while (i j [i].key = temp.key) { the + +; doc + +. } [j].key = a [i].key; y3 + +; } [i] = temp; y3 + +; if (left - i - 1) quicksort (a, left, - 1); doc + +. if (i + 1) (right) quicksort (a, + 1, right). doc + +. } / / 堆排序 void heapsift (elemtype [], int s, int m) { elemtype temp. int j; s = [s]. j = 2 * d; y4 + +; while (j = m) { b4 + +; if (j m a [j].key [j + 1].key) { j + +. b4 + +; } if (temp.key [j].key) { b4 + +; [d] = a [j]; s = j; j = j * 2); y4 + +; } else j = m + 1. } [d] = temp; y4 + +; } void heapsort (elemtype [], int length) { int i, j; elemtype temp. for (i = length / 2; i = 1; -) heapsift (the length). for (j = length; j = 2; j -) { s = [1]. in [1] = a [j]. a [j] = temp; heapsift (a, 1, - 1); y
您可能关注的文档
- 天天英语(Everyday English).doc
- 天津市可持续发展示范点申报登记表(Tianjin sustainable development demonstration site declaration form).doc
- 天津市城乡居民基本养老保障规定(Provisions on basic old-age insurance for urban and rural residents in Tianjin).doc
- 天津市境内海河水系水源保护暂行条例(Interim Regulations on the protection of water resources in Haihe River System in Tianjin).doc
- 天津09年自考包装结构与包装装潢设计考试大纲(Tianjin 09 year self examination packaging structure and packaging design examination outline).doc
- 天津市菜市场管理办法(Measures for the administration of the vegetable market in Tianjin).doc
- 天津市道路交通安全防范责任制规定(Provisions of the Tianjin Municipality on the responsibility system for road traffic safety).doc
- 天津某麦当劳(A McDonald's in Tianjin).doc
- 天津市禁止违法建设规定(Regulations prohibiting illegal construction in Tianjin).doc
- 天津港保税区土地管理规定(Regulation of land administration of Tianjin Port Free Trade Zone).doc
- 数控介绍(NC introduction).doc
- 数控g指令和m指令(NC g instructions and m instructions).doc
- 数控编程指令(NC programming instruction).doc
- 数码产品调查(Digital product survey).doc
- 数码相机使用注意事项(Considerations for digital cameras).doc
- 数码相机存储卡数据恢复软件大全(Digital camera memory card data recovery software).doc
- 数码管时钟c语言程序(Digital tube clock C language program).doc
- 数码管显示用延时(Time delay for digital tube display).doc
- 数控机床论文数控机床 论文(CNC machine tools, CNC machine tools).doc
- 数码管电子钟(可调时)程序(Digital tube electronic clock (adjustable time) program).doc
最近下载
- 高质量发展下医院感染监测与防控技术题库答案-2025年华医网继续教育.docx VIP
- GB T 34986-2017 产品加速试验方法.doc VIP
- MicroLogix1400可编程控制器-RockwellAutomation.PDF
- 医学影像科质量与安全管理指标统计分析表.docx VIP
- 视频监控维护培训.pptx VIP
- 《体育绘图》单线条人体动作简笔画课件.pptx VIP
- 中国普通食物营养成分表(修正版).xls VIP
- 2022年中国电信云网资源管理技能认证考试题库资料(精简500题).pdf VIP
- 房建项目维保手册.docx VIP
- 【2025秋】北师大版二年级数学上册教学计划(含进度表).docx
文档评论(0)