Abstract:
According to the definition of the max-heap,this paper presents a new enumeration counting formula of the max-heap while generating the n-tuples permutation representing a n-node max-heap. And the special condition when the max-heap is a full binary tree is discussed . At last, an O( n) time algorithm of calculating the enumeration number of any max-heap is given.
摘要: 根据堆的定义,在构造与最大值堆对应的n元排列的过程中推导出了n个结点最大值堆的枚举总数目的计算公式,讨论了当堆为满堆时的情况,给出了一个复杂度为O(n)的算法实现了任意最大值堆的枚举计数公式。
关键词:
最大值堆,
枚举公式,
算法,
排列
CLC Number:
DONG Zhaoan, SUN Qiang. A New Algorithm of Calculating Enumeration Number of Any Max-heap[J]. , 2005, 31(06): 76-.
董兆安,孙强. 最大值堆的枚举计数公式及其实现[J]. , 2005, 31(06): 76-.