| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 858 人关注过本帖
标题:[求助] heap sort 排序算法(堆排序) problem
只看楼主 加入收藏
vincenthwc
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2006-10-31
收藏
 问题点数:0 回复次数:0 
[求助] heap sort 排序算法(堆排序) problem

This program need to print all the stage, but only print the number. For example, stage 1- only print 4 1 3 2 16 9 10 14 8 7

input> 4 1 3 2 16 9 10 14 8 7
stage1: 4 1 3 2 16 9 10 14 8 7
stage 2: 4 1 3 2 16 * 9 10 14 8 7
stage 3: 4 1 3 2 * 16 9 10 14 8 7
stage 4: 4 1 3 * 14 16 9 10 2 8 7
stage 5: 4 1 * 10 14 16 9 3 2 8 7
stage 6: 4 * 16 10 14 7 9 3 2 8 1
stage 7: 16 14 10 8 7 9 3 2 4 1
stage 8: 14 8 10 4 7 9 3 2 1 * 16
stage 9: 10 8 9 4 7 1 3 2 * 14 16
stage 10: 9 8 3 4 7 1 2 * 10 14 16
stage 11: 8 7 3 4 2 1 * 9 10 14 16
stage 12: 7 4 3 1 2 * 8 9 10 14 16
stage 13: 4 2 3 1 * 7 8 9 10 14 16
stage 14: 3 2 1 * 4 7 8 9 10 14 16
stage 15: 2 1 * 3 4 7 8 9 10 14 16
stage 16: 1 * 2 3 4 7 8 9 10 14 16
Final stage 17: 1 2 3 4 7 8 9 10 14 16

Thank you

[此贴子已经被作者于2006-10-31 22:07:07编辑过]

搜索更多相关主题的帖子: heap sort problem 算法 
2006-10-31 17:42
快速回复:[求助] heap sort 排序算法(堆排序) problem
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.025280 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved