- 1、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
c语言排序(C language sorting)
c语言排序(C language sorting) This is the c++ insertion sorting source See for yourself!! # include iostream.h # include conio.h # define MAXSIZE 20 # define MAX_LENGTH 100 Typedef int RedType; Typedef struct {RedType r[MAXSIZE+1]; Int length; }SqList; Void InsertSort (SqList L) {int, I, j; For (i=2; I =L.length; ++i) If (L.r[i], L.r[i-1]) {L.r[0]=L.r[i]; For (j=i-1; L.r[0] L.r[j]; --j) L.r[j+1]=L.r[j]; L.r[j+1]=L.r[0]; } } Void, main () {int i; SqList L; Cout endl endl InsertSort.cpp; Cout endl ==============; Cout endl Please, input, the, length, of, SqList (eg, 5): endl endl; Cin L.length; For (i=1; I =L.length; ++i) {cout input the i th integer (eg, 58) Please:; Cin L.r[i]; } Cout endl The disordered:; For (i=1; I =L.length; i++) Cout L.r[i] ; InsertSort (L); Cout endl The ordered:; For (i=1; I =L.length; i++) Cout L.r[i] ; Cout endl endl ... OK!...; Getch (); I throw a brick of useful [0] [0] reference report recommended: senior management TOP essence, why a lot of people say that the true master is the master C rather than C++. Sylmoon (wolf alone) Grade: #6 building score: 15 reply: 2002-06-19 21:02:37, first look at the most basic array sorting - bubble sort. For example, we have an array of: 2, 57, 29, 89, 42, 34, 16, 1. By comparing bubbles, large sinks, small floats, the adjacent values are compared, Big back row. If the two adjacent values are in ascending order, they remain the same, if they are in descending order Exchange their values: Start: a[0]2, a[1]57, a[2]29, a[3]89, a[4]42, a[5]34, a[6]16, a[7]1 1, times:2, 29, 57, 42, 34,, 16, 1, 89 2, times:, 2, 29, 42, 34,, 16, 1, 57, 八十九 3次:2, 29, 34,16, 1, 42,57, 89 4次:2, 29, 16,1, 34, 42,57, 89 5次:2, 16, 1,29, 34, 42,57, 89 6次:2, 1, 16,29, 34, 42,57, 89 7次:1, 2, 16,29, 34, 42,57, 89 我们可以用两个循环来控制排序,一个控制趟数,一个控制每趟的排序。 控制趟数是1到7 控制每趟的比较次数也是1到7 推广一下:有N个项的数组,如果要实行冒泡排序,最多排N-1次,每次比较N-1次。 经过我们自己的思考+书上的提示,写下了冒泡排序的源程序: #包括 stdio. h #包括是。H #定义尺寸8 main() { a [尺寸] = { 2,57,29,89,42,34,16,1
您可能关注的文档
- ie部如何协助车间提高生产效率.及影响车间效率低下的原因docx(How does the IE department assist the workshop in improving production efficiency and affecting the efficiency of the workshop docx).doc
- iges破面修补(iges破面修补).doc
- illustrator 快捷键(插画快捷键).doc
- informix触发器(Informix flip-flop).doc
- invitrogen引物设计参考标准(invitrogen引物设计参考标准).doc
- ios学习笔记010--构造类型及结构体(IOS learning notes, 010-- constructs, types, and structures).doc
- ios5.1.1完美越狱后必装百款插件大全(Ios5.1.1 perfect jailbreak, you have to install hundreds of plug-in Daquan).doc
- ipad3越狱后需要安装的插件(Ipad3 jailbreak after you need to install plug-ins).doc
- iphone 5.1.1越狱安装(5.1.1越狱安装iPhone).doc
- iphone4实用(iPhone4实用).doc
- c语言曲线拟合(C language curve fitting).doc
- c语言常用排序全解(C language commonly used sorting complete solution).doc
- c语言与c++的区别(The difference between C language and c++).doc
- d-a-01 目标客户业务介绍-移动品牌介绍(D-a-01 target customer business - Mobile Brand Introduction).doc
- currency (世界各国货币名称)(Currency (currency names all over the world)).doc
- c语言城市链表(C language city list).doc
- c语言系统函数(C language system function).doc
最近下载
- 13J104建筑工程.房屋建筑.蒸压加气混凝土砌块、板材构造.pdf VIP
- 2014地铁车站防火封堵设计要求基础介绍.doc VIP
- 《BIM建模技术》教案——5创建结构板.docx VIP
- 企业人力资源管理师(三级)真题及答案.docx VIP
- 面向设计的地铁车站防火安全韧性评价_夏侯遐迩.pdf VIP
- 2025花城版音乐三年级上册《我爱米兰》课堂教学设计.docx
- 《BIM建模技术》教案——4创建梁.docx VIP
- 2025年必威体育精装版党员领导干部廉洁自律知识竞赛题库附带答案.docx VIP
- 管道支架重量估算表(超全,超好) (2).xls VIP
- IE七大手法培训资料.pptx VIP
有哪些信誉好的足球投注网站
文档评论(0)