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.
Talk to us
Join us for a 30 min session where you can share your feedback and ask us any queries you have
Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.