mfc动态演示排序算法

实现的排序算法

冒泡排序、选择排序、快速排序

具体实现

选用mfc中的单文档框架

①SetTimer函数的用法。

②使用画笔画直线。

③使用FillSolidRect()函数覆盖某一矩形区域内的内容;使用TextOutW()函数在某坐标位置输出字符串。

效果截图

1.生成随机数

2.选择一种排序算法

3.加速减速暂停继续

4.排序完成

 参考资料:

SelectObject的使用:
https://blog.csdn.net/qq_17242957/article/details/38588055
https://zhidao.baidu.com/question/263248386.html

SetTimer函数用法:
http://blog.sina.com.cn/s/blog_659348480100nj97.html
https://blog.csdn.net/u013541325/article/details/41143495
https://baike.baidu.com/item/SetTimer/5015868?fr=aladdin
https://www.cnblogs.com/akb48/p/4764037.html

可到我的Github获取源代码:https://github.com/Hahallo/SortAlgorithmDisplay

 

作者:Hahallo
         
本文版权归作者和博客园共有,未经作者同意不能转载,否则保留追究法律责任的权利。
原文地址:https://www.cnblogs.com/bigyang/p/9058588.html