文件名称:WinnerTree
- 所属分类:
- 数据结构常用算法
- 资源属性:
- [C/C++] [源码]
- 上传时间:
- 2012-11-26
- 文件大小:
- 2kb
- 下载次数:
- 0次
- 提 供 者:
- liyua*****
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
常见的实现方法是使用两个数组,
t[n-1]和e[n],数组e存放所有的参加排序的元素,在完全二叉树中是叶子结点,t[]存放
的是比赛的阶段性胜者的编号,再进行n趟比赛排序结束,时间复杂度是O(n*log2(n)),
其实我觉得也可以只通过一个数组A[2*n-1]也可以实现,只是标号的换算有点复杂而已.
-Common implementation approach is to use two array, t [n-1] and e [n], the array storage of all e sort of take part in the elements, are in complete binary tree in leaf nodes, t [] are stored stage game winner serial number and then sort the end of n times a game, time complexity is O (n* log2 (n)), in fact I think it is only through an array A [2* n-1] can also be implementation, but labeling it a bit complicated conversion.
t[n-1]和e[n],数组e存放所有的参加排序的元素,在完全二叉树中是叶子结点,t[]存放
的是比赛的阶段性胜者的编号,再进行n趟比赛排序结束,时间复杂度是O(n*log2(n)),
其实我觉得也可以只通过一个数组A[2*n-1]也可以实现,只是标号的换算有点复杂而已.
-Common implementation approach is to use two array, t [n-1] and e [n], the array storage of all e sort of take part in the elements, are in complete binary tree in leaf nodes, t [] are stored stage game winner serial number and then sort the end of n times a game, time complexity is O (n* log2 (n)), in fact I think it is only through an array A [2* n-1] can also be implementation, but labeling it a bit complicated conversion.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
WinnerTree.cpp