CDN加速镜像 | 设为首页 | 加入收藏夹
当前位置: 首页 资源下载 源码下载 数值算法/人工智能 数据结构常用算法

文件名称:Heap-sort

  • 所属分类:
  • 标签属性:
  • 上传时间:
    2012-12-23
  • 文件大小:
    1006byte
  • 已下载:
    0次
  • 提 供 者:
  • 相关连接:
  • 下载说明:
    别用迅雷下载,失败请重下,重下不扣分!
电信下载 联通下载
别用迅雷、360浏览器下载。
如迅雷强制弹出,可右键点击选“另存为”。
失败请重下,重下不扣分。

介绍说明--下载内容来自于网络,使用问题请自行百度

堆排序

 堆排序利用了大根堆(或小根堆)堆顶记录的关键字最大(或最小)这一特征,使得在当前无序区中选取最大(或最小)关键字的记录变得简单。   (1)用大根堆排序的基本思想   ① 先将初始文件R[1..n]建成一个大根堆,此堆为初始的无序区   ② 再将关键字最大的记录R[1](即堆顶)和无序区的最后一个记录R[n]交换,由此得到新的无序区R[1..n-1]和有序区R[n],且满足R[1..n-1].keys≤R[n].key   ③由于交换后新的根R[1]可能违反堆性质,故应将当前无序区R[1..n-1]调整为堆。然后再次将R[1..n-1]中关键字最大的记录R[1]和该区间的最后一个记录R[n-1]交换,由此得到新的无序区R[1..n-2]和有序区R[n-1..n],且仍满足关系R[1..n-2].keys≤R[n-1..n].keys,同样要将R[1..n-2]调整为堆。   ……   直到无序区只有一个元素为止。   (2)大根堆排序算法的基本操作:   ① 初始化操作:将R[1..n]构造为初始堆;   ② 每一趟排序的基本操作:将当前无序区的堆顶记录R[1]和该区间的最后一个记录交换,然后将新的无序区调整为堆(亦称重建堆)。 -Heap sortHeap sort heap sort using the root pile ( or small stack stack top ) the record of the keyword maximum ( or minimum ) of this feature, the present disordered select the maximum (or minimum ) keyword records made simple. ( 1 ) with a large root heap sort of basic ideas of the initial file R[1..N] built a large root pile, the pile as the initial disordered regions of the keywords maximum recorded R[1] (i.e. top ) and disordered regions recorded one of the last R[n] exchange, the new R [1..N-1] and disordered zone ordered region R[n], and satisfy the R[1..N-1].keys≤ R[n].key③due to exchange new root R[1] may violate the heap property, so should be the present disordered R[1..N-1] adjustment for reactor. Then again in the R[1..N-1] keyword best record R[1] and the interval of the last record of a R[n-1] exchange, thus get new disordered and ordered R[1..N-2] R[n-1..N], and still meet the relationship between R[1..N-2].keys≤ R[n-1..N].keys, R[1..N-2] also will adjust for reactor. .
(系统自动生成,下载前可以参看下载内容)

下载文件列表

堆排序/堆排序(原创).txt
堆排序/网上资源.txt
堆排序

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 搜珍网是交换下载平台,只提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度。更多...
  • 本站已设置防盗链,请勿用迅雷、QQ旋风等下载软件下载资源,下载后用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或换浏览器;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.

相关评论

暂无评论内容.

发表评论

*快速评论: 推荐 一般 有密码 和说明不符 不是源码或资料 文件不全 不能解压 纯粹是垃圾
*内  容:
*验 证 码:
搜珍网 www.dssz.com

浏览历史记录

关闭