作者投稿和查稿 主编审稿 专家审稿 编委审稿 远程编辑

计算机工程 ›› 2006, Vol. 32 ›› Issue (20): 62-64. doi: 10.3969/j.issn.1000-3428.2006.20.023

• 软件技术与数据库 • 上一篇    下一篇

一种生成所有堆的枚举算法

杜慧江1,孙 强2   

  1. (1. 上海医疗器械高等专科学校医用电子仪器系,上海 200093; 2. 华东师范大学计算机科学技术系,上海 200062)
  • 收稿日期:1900-01-01 修回日期:1900-01-01 出版日期:2006-10-20 发布日期:2006-10-20

Enumeration Algorithm of Generation All Heaps

DU Huijiang1, SUN Qiang2   

  1. (1. Department of Medical Electronics Apparatus, College of Medical Apparatus and Instruments, Shanghai 200093; 2. Department of Computer Science and Technology, East China Normal University, Shanghai 200062 )
  • Received:1900-01-01 Revised:1900-01-01 Online:2006-10-20 Published:2006-10-20

摘要: 提出了一种生成所有堆的枚举算法,该算法采用了递归子树判断法,递归地将待生成的堆分为左右2个子树判断,并结合层次判断方法,提高了算法的效率,测试结果验证了该算法的有效性和可靠性。

关键词: 生成, 堆, 层次算法, 递归子树判断

Abstract: This paper puts forward an improvement on an enumeration algorithm of generation all heaps. Recursion judgement on left subtree and right subtree and judegment of hierarchy are combined to raise the efficiency of the algorithm. The test results indicate the validity and reliability of the algorithm.

Key words: Generation, Heap, Recursion algorithm, Judgement of hierarchy subtree