摘要
根据最小最大堆的定义,对n元排列组合进行该堆的构造并推导出对应的n个结点最小最大值可能存在的堆枚举总数目的计算公式;并给出了在满堆情况下,时间复杂度为O(n)的任意最小最大堆得枚举算法实现。
According to the definition of the min-heap and max-heap.this paper presents a new enumeration counting formula of the min-heap and max-heap while generating the n-tipples permutation representing a n-node min-heap and max-heap.And the special condition when the min-heap and max-heap is a full binary tree is discussed.At last,an O(n) time algorithm of actuating the enumeration number of any min-heap and max-heap is given.
出处
《电脑知识与技术》
2011年第12X期9541-9543,共3页
Computer Knowledge and Technology
关键词
最小最大值堆
枚举公式
算法
排列
min-heap and max-heap
enumeration formula
algorithm
permutation