Recognizing Well-Parenthesized Expressions in the Streaming Model
Author(s) -
Frédéric Magniez,
Claire Mathieu,
Ashwin Nayak
Publication year - 2014
Publication title -
siam journal on computing
Language(s) - English
Resource type - Journals
SCImago Journal Rank - 1.533
H-Index - 122
eISSN - 1095-7111
pISSN - 0097-5397
DOI - 10.1137/130926122
Subject(s) - streaming algorithm , mathematics , multiplicative function , binary logarithm , space (punctuation) , communication complexity , combinatorics , upper and lower bounds , overhead (engineering) , discrete mathematics , matching (statistics) , reduction (mathematics) , algorithm , computer science , statistics , mathematical analysis , geometry , operating system
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 parentheses. We present a one-pass randomized streaming algorithm for Dyck(2) with space of ${O}(\sqrt{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. 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 of ${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 e...
Accelerating Research
Robert Robinson Avenue,
Oxford Science Park, Oxford
OX4 4GP, United Kingdom
Address
John Eccles HouseRobert Robinson Avenue,
Oxford Science Park, Oxford
OX4 4GP, United Kingdom