Location of Repository

Motivated by a concrete problem and with the goal of understanding the relationship between the complexity of streaming algorithms and the computational complexity of formal languages, we investigate the problem DYCK(s) of checking matching parentheses, with s different types of parenthesis. We present a one-pass randomized streaming algorithm for DYCK(2) with space O ( √ n log n) bits, time per letter polylog(n), and one-sided error. We prove that this one-pass algorithm is optimal, up to a log n factor, even when two-sided error is allowed, and conjecture that a similar bound holds for any constant number of passes over the input. Surprisingly, the space requirement shrinks drastically if we have access to the input stream in reverse. We present a two-pass randomized streaming algorithm for DYCK(2) with space O((log n) 2), time polylog(n) and one-sided error, where the second pass is in the reverse direction. Both algorithms can be extended to DYCK(s) since this problem is reducible to DYCK(2) for a suitable notion of reduction in the streaming model. Except for an extra O ( √ log s) multiplicative overhead in the space required in the one-pass algorithm, the resource requirements are of the same order. For the lower bound, we exhibit hard instances ASCENSION(m) of DYCK(2) with length Θ(mn)

Year: 2011

OAI identifier:
oai:CiteSeerX.psu:10.1.1.192.5237

Provided by:
CiteSeerX

Download PDF: