Abstract
We consider the following problem. For a binary tree T=(V,E) where V={1, 2,...,n}, given its inorder traversal and either its preorder traversal or it postorder traversal, reconstruct the binary tree. We present a new parallel algorithm for this problem. Our algorithm requires O(n) space. The main idea of our algorithm is to reduce the reconstruction process to parallel merging. With the best results for parallel merging, our algorithm can be implemented in O(logn) time using O(n/logn) processors on the EREW PRAM, or in O(loglogn) time using O(n/log logn) processors on the CREW PRAM. Consequently, an ordered tree can be reconstructed from its preorder and postorder traversals. Our results improve the best previous results for this problem in literature either in cost or in the model of computation.
This is a preview of subscription content, log in via an institution.
Preview
Unable to display preview. Download preview PDF.
References
A. Anderson, S. Carlsson, “Construction of a tree from its traversals in optimal time and space,” Information Processing Letters, 34 (1990) pp. 21–25
R. J. Anderson, E. W. Mayr and M. K. Warmuth, “Parallel approximation algorithms for bin packing,” Information and Computation, 82, October, 1989, pp. 262–277.
O. Berkman, Z. Galil, B. Schieber and U. Vishkin, “Highly Parallelizable Problems,” in Proceedings of the IEEE Symposium on Foundation of Computer Science, 1989.
G. H. Chen, M. S. Yu and L. T. Liu, “Two algorithms for constructing a binary tree from its traversals,” Information Processing Letters, 28 (1988) pp. 297–299.
R. Cole, “Parallel Merge sort,” in Proceedings of the 27th Annual IEEE Symposium on the Foundations of Computer Science, 1986, pp. 511–516.
R. Cole and U. Vishkin, “Approximate and exact parallel scheduling with applications to list, tree and graph,” Proc. 27th Annual Symp. on Foundations of Computer Science, 1986, pp. 487–491.
C. Kruskal, “Searching, merging and sorting in parallel computation,” IEEE Transactions on Computers C-32, 10 (October), pp.942–946.
D. E. Knuth, The Art of Computer Programming, Vol. 1, Fundamental Algorithms, Second Edition, Addison-Wesley, Reading, Mass., 1973.
F. Springsteel, I. Stojmenovic, “Parallel general prefix computations with geometric, algebraic and other applications,” In Proceedings of International Conference on Fundamentals of Computation Theory, Szeged, Hungary, August 1989, 424–433, Springer-Verlag.
R. E. Tarjan and U. Vishkin, “Finding biconnected and computing tree functions in logarithmic parallel time,” in Proceedings of the 25th Annual Symposium on Foundations of Computer Science, 1984, pp. 12–22.
U. Vishkin, “Synchronous parallel computation,” a Survey, TR 71, Dept. of Computer Science, Courant Institute, NYU, 1983.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1991 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Olariu, S., Overstreet, M., Wen, Z. (1991). An optimal parallel algorithm to reconstruct a binary tree from its traversals. In: Dehne, F., Fiala, F., Koczkodaj, W.W. (eds) Advances in Computing and Information — ICCI '91. ICCI 1991. Lecture Notes in Computer Science, vol 497. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-54029-6_198
Download citation
DOI: https://doi.org/10.1007/3-540-54029-6_198
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-54029-8
Online ISBN: 978-3-540-47359-6
eBook Packages: Springer Book Archive