标题:[求助] heap sort 排序算法(堆排序) problem
取消只看楼主
vincenthwc
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2006-10-31
 问题点数:0 回复次数:0 
[求助] heap sort 排序算法(堆排序) problem

Is anyone know how to do this program? 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

搜索更多相关主题的帖子: heap sort problem 算法 
2006-10-31 22:09



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-100019-1-1.html




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

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