首页> 中文期刊> 《武汉工业学院学报》 >一种无需借助栈的严格平衡二叉树建立

一种无需借助栈的严格平衡二叉树建立

             

摘要

Because establishment of a strict balanced two binary tree needs the help of the stack , this paper presents an algorithm to establish a strict balanced two binary tree without the help of the stack .In order to search for key-words in half , it needs to sort the existing keyword sequence .It statistics the number of comparision in binary search in the ordered keyword sequence .A strict balanced binary tree sequence will be obtained by the sortion of the times of comparison of the keywords after the statistics .Finally, a strict balance two fork tree is obtained after every keyword has been successively inserted into the two binary sort tree on non recursive insertion algorithm .The results of the examples show that a strict balance two fork tree can also be established without the help of the stack .%针对当前严格平衡二叉树的建立需要借助栈来实现的问题,提出一种无需借助栈也能建立严格平衡二叉树的算法。为能对关键字进行二分查找,需要对现有的关键字序列进行排序,以便统计关键字的有序序列中每个关键字在二分查找时的比较次数。在统计完所有关键字的二分查找的比较次数后,通过关键字比较次数序列的排序得到严格平衡二叉树序列。最后,用非递归的二叉排序树插入算法依次插入严格平衡二叉树序列的每个关键字,得到的二叉排序树就是一棵严格平衡二叉树。算例仿真表明,无需借助栈也可建立一棵严格平衡二叉树。

著录项

相似文献

  • 中文文献
  • 外文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号