期刊文献+

一种由遍历序列构造二叉树的改进算法 被引量:1

An improved algorithm for constructing two binary trees by traversing sequences
下载PDF
导出
摘要 针对现有构造二叉树的算法无法适用于具有相同元素的遍历序列,提出了一种解决该问题的递归算法。该种算法以现有的递归算法为基础,通过引入遍历序列的标志序列,依据标志序列中元素之间的关系,从理论上证明了三种由遍历序列构造二叉树的算法都具有递归性。根据遍历序列构造二叉树的递归原理,设计了三种不同的由遍历序列构造二叉树的递归算法。通过算例仿真表明,使用笔者设计的算法可为具有相同元素的遍历序列构造二叉树。 In view of the present algorithm can not be applied to construct the binary tree by using the traversal sequence which has the same elements,this paper presents a recursive algorithm to solve the problem. Based on the existing recursive algorithm,this algorithm introduces the symbol sequence of the traversal sequence. According to the relationship among the elements in the symbol sequence,the three algorithms are proved theoretically to be recursive for using the traversal sequences to construct the binary tree. Based on the recursive principle of constructing the two binary tree by the travel sequences,three different recursive algorithms are designed to construct the binary tree. Simulation results show that the algorithm can be used to construct the two binary tree by using the traversal sequences in which there are the same elements.
出处 《武汉轻工大学学报》 2016年第3期68-73,共6页 Journal of Wuhan Polytechnic University
基金 国家自然科学基金资助项目(61179032)
关键词 先序遍历 中序遍历 后序遍历 标志序列 递归算法 preorder traversal inorder traversal postorder traversal flag sequence recursive algorithm
  • 相关文献

参考文献11

二级参考文献56

  • 1孟林,尹德辉.二叉树遍历递归算法非递归化的讨论[J].福建电脑,2004,20(6):30-31. 被引量:7
  • 2徐志烽.通过先序序列和中序序列建二叉树[J].中山大学研究生学刊(自然科学与医学版),2004,25(4):119-125. 被引量:5
  • 3朱涛.基于遍历二叉树的方法判断完全二叉树[J].红河学院学报,2005,3(6):47-48. 被引量:2
  • 4张茗,王腾蛟,赵海燕.数据结构与算法[M].北京:高等教育出版社,2008:90-92.
  • 5张国.基于递归算法的非递归实现研究.长江大学学报自然科学版,2009,6(3):223-225.
  • 6Makinen E. Constructing a binary tree efficiently from its traversals [ J ]. International Journal of Computer Mathematics, 2000, 75 (2) :143 -147.
  • 7唐自立.基于遍历序列的构造二叉树的算法[C]//全国计算机技术应用与高等学校计算机教育论文集:第1卷,成都:西南交通大学出版社,2009:394-397.
  • 8Knuth D E. The art of computer programming, volume 1: fundamental algorithms [ M ]. 3rd ed. MA : Addison-Wes- ley, 1997.
  • 9Andersson A, Carlsson S. Construction of a tree from its traversals in optimal time and space [J ]. Information Pro- cessing Letters, 1990, 34 ( 1 ) : 21-25.
  • 10Burgdorff H A, Jajodia S, Springsteel F N, et al. Alterna- tive methods for the reconstruction of trees from their traver- sals [J]. BIT Numerical Mathematics, 1987, 27 (2) : 133- 140.

共引文献10

同被引文献9

引证文献1

相关作者

内容加载中请稍等...

相关机构

内容加载中请稍等...

相关主题

内容加载中请稍等...

浏览历史

内容加载中请稍等...
;
使用帮助 返回顶部