Abstract
We present an optimal parallel algorithm (log 2 n time, n/log 2 n processors) for computing the matching function for a sequence of brackets and for transforming sequences of brackets to trees on the parallel access machine without read and write conflicts (EREW PRAM). It gives also an optimal parallel transformation on EREW PRAM of texts of expressions to expression-trees. Previously an optimal parallel algorithm for this problem was known (Bar-On, Vishkin (1985)) on a stronger model of parallel computations (CREW PRAM), where read conflicts were essential. It is not clear presently how big the difference is between the power of CREW and EREW PRAMs. Our result implies optimal parallel algorithms on EREW PRAM for several other algorithmic problems which previously had optimal parallel algorithms only on a CREW PRAM: expression evaluation (Abrahamson (1987); Brent (1974); Gibbons, Rytter (1986); Miller, Reif (1985)); recognition of input-driven languages (Gibbons, Rytter (1988)); transforming regular expressions to finite automata (Rytter 1987)) and parsing bracket languages (Rytter, Giancarlo (1987)). If the tree of the expression is given then the expression can be optimally evaluated on the EREW PRAM, see Cole, Vishkin (1988); Kosaraju, Delcher (1988). However optimal parallel transformation of expression to corresponding trees was previously known only on the CREW PRAM. The structure of our algorithm for computing the matching function is similar to that of Bar-On and Vishkin (1985). The matching function is computed in the preprocessing phase for a subset of O n/log 2 n) brackets and later it guides the computation for all brackets. Our initial subset of brackets is a subset of that used in Bar-On, Vishkin (1985). It is small enough to eliminate read conflicts in the preprocessing phase, however it complicates other phases.
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.