1 research outputs found

    Reconstructing a Binary Tree from its Traversals in Doubly-Logarithmic CREW Time

    No full text
    We consider the following problem. For a binary tree T = (V; E) where V = f1; 2; :::; ng, given its inorder traversal and either its preorder or its 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 merging two sorted sequences. With the best parallel merging algorithms, our algorithm can be implemented in O(log log n) time using O( n log log n ) processors on the CREW PRAM (or in O(log n) time using O( n log n ) processors on the EREW PRAM). Our result provides one more example of a fundamental problem which can be solved by optimal parallel algorithms in O(log log n) time on the CREW PRAM. 1 Introduction We consider the problem of reconstructing a binary tree T = (V; E) with vertices f1; 2; :::; ng given its inorder traversal and either its preorder or its postorder traversal. It is well-known that a binary tree can..
    corecore