期刊文献+

一种由层次遍历和其它遍历构造二叉树的新算法

A new algorithm which constructs the binary tree by using the level traversal and the other traversal
下载PDF
导出
摘要 在由遍历序列构造二叉树问题的研究中,针对目前还没有用层次遍历和其它遍历一起构造二叉树的问题,提出了一种由层次遍历和其它遍历一起构造二叉树的新算法。考虑到层次遍历中左子树和右子树的层次遍历不具有递归属性,设计了从层次遍历中分离出左右子树层次遍历的方法,并且通过组合得到具有递归属性的层次遍历。通过对层次遍历和中序遍历的递归属性的研究,设计了由层次遍历和中序遍历构造二叉树的递归算法;通过对层次遍历和先序遍历的递归属性的研究,设计了由层次遍历和中序遍历构造没有出度为1的二叉树的递归算法;通过对层次遍历和后序遍历的递归属性的研究,设计了由层次遍历和后序遍历构造没有出度为1的二叉树的递归算法。仿真结果表明,用设计的算法构造二叉树是有效的,可为二叉树的构造提供新算法。 In the study which uses traversal sequences to construct the binary tree,in view of The fact that it is not used to construct the binary tree by using the level traversal and the other traversal,a new algorithm is put forward to construct the binary tree by using the level traversal and the other traversal. Considering that there is not recursive attribute in the level traversal of the left sub tree and the right sub tree,a method is designed to isolate the left subtree level traversal and the right subtree level traversal from the level traversal,and recursive property is gained through the combination with the two sub level traversals. By the recursive property of the level traversal and the inorder traversal,a recursive algorithm is designed to construct the binary tree by using the level traversal and inorder traversal. Through the research of the recursive attribute between the level traversal and the preorder traversal,a recursive algorithm is designed to construct the binary tree. By the research of the recursive attribute between the level traversal and the postorder traversal,a recursive algorithm is designed to construct the binary tree. The simula-tion results show that the algorithm is effective for constructing the binary tree and can provide a new algorithm for the construction of the binary tree.
出处 《武汉轻工大学学报》 2016年第4期67-72,共6页 Journal of Wuhan Polytechnic University
基金 国家自然科学基金资助项目(61179032)
关键词 层次遍历 先序遍历 中序遍历 后序遍历 递归算法 Level traversal preorder traversal inorder traversal postorder traversal recursive algorithm
  • 相关文献

参考文献10

二级参考文献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. 被引量:3
  • 5张国.基于递归算法的非递归实现研究.长江大学学报自然科学版,2009,6(3):223-225. 被引量:3
  • 6Makinen E. Constructing a binary tree efficiently from its traversals [ J ]. International Journal of Computer Mathematics, 2000, 75 (2) :143 -147. 被引量:1
  • 7唐自立.基于遍历序列的构造二叉树的算法[C]//全国计算机技术应用与高等学校计算机教育论文集:第1卷,成都:西南交通大学出版社,2009:394-397. 被引量:3
  • 8Knuth D E. The art of computer programming, volume 1: fundamental algorithms [ M ]. 3rd ed. MA : Addison-Wes- ley, 1997. 被引量:1
  • 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. 被引量:1
  • 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. 被引量:1

共引文献10

相关作者

内容加载中请稍等...

相关机构

内容加载中请稍等...

相关主题

内容加载中请稍等...

浏览历史

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