c++单向链表的排序
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
c++单向链表的排序
河北联合大学
2011-2012第2学期
《软件设计基础-C++》
课程设计报告
设计名称:设计一个处理单向链表的程序:链表的排序
姓名:王学增学号:201005100206
专业班级:土木工程1班
学院:建筑工程学院
设计时间:2012-5-31
设计地点:机房
指导教师评语:
教师评定:自评成绩;75
指导教师签字:
年月日
年月日
目录
1.课程设计目的 ···············································································
2.课程设计任务与要求 ······································································
3.课程设计说明书 ············································································
4.课程设计成果 ···············································································
5.程序调试过程 ···············································································
6.设计问题的不足和改进方案 ·····························································
7.课程设计心得 ···············································································
8.参考文献 ·····················································································
cout<<"\n
(接上页)
i=1
判断i>n?
否
执行
i=i+1
结束循环,cout<<"
(2)泡沫排
序的流程图
}
(2)运行以上源程序后的运行结果:
写出程序调试步骤,及遇到的问题。
(1)这时程序已经可以运行,但数据出现错误:没有输出第一组数。
这是字符数组那块的知识,在数据前加上“0,"","",”即可是程序完整显示。
需要在数据打印模块中每一个for循环后加cout<<"\n";
调试后的结果为:
(3)下面对每组数据的间隔进行处理
将语句cout< 调试后的程序: 再改进一下间距: (4)调试到现在程序已经大概完成,为与结果一样,需要在主函数中,print(a,10);后加上cout<<"\n"; 得到下面程序: