An Improved Algorithm for Constructing Binary Trees Using the Traversal Sequences
暂无分享,去创建一个
The present algorithm can not be applied to construct a binary tree by using the traversal sequences in which there are same elements. That is to say, the previous algorithms require there are not same elements in the binary tree. This paper designs an improved recursive algorithm to solve the problem. Based on the existing recursive algorithm, this algorithm introduces flag sequences for the traversal sequences. According to the relationship among the elements in the flag sequences, it is theoretically proved that there are three recursive algorithms that can construct binary trees from the traversal sequences. Simulation results show that the algorithm designed in this paper can construct binary trees through the traversal sequences in which there are same elements.
[1] E. Mäkinen. Constructing a binary tree from its traversals , 1989 .
[2] Erkki Mäkinen. Constructing a binary tree efficiently from its traversals , 2000, Int. J. Comput. Math..
[3] Zhu Tao. Analysis Based On Traversal Sequence To Build Binary Tree , 2013 .