A simple optimal representation for balanced parentheses

26Citations
Citations of this article
1Readers
Mendeley users who have this article in their library.
Get full text

Abstract

We consider succinct, or highly space-efficient, representations of a (static) string consisting of n pairs of balanced parentheses, that support natural operations such as finding the matching parenthesis for a given parenthesis, or finding the pair of parentheses that most tightly enclose a given pair. This problem was considered by Jacobson, [Proc. 30th FOCS, 549-554, 1989] and Munro and Raman, (SIAM J. Comput. 31 (2001), 762-776], who gave O(n)-bit and 2n + o(n)-bit representations, respectively, that supported the above operations in O(1) time on the RAM model of computation. This data structure is a fundamental tool in succinct representations, and has applications in representing suffix trees, ordinal trees, planar graphs and permutations. We consider the practical performance of parenthesis representations. First, we give a new 2n + o(n)-bit representation that supports all the above operations in O(1) time. This representation is conceptually simpler, its space bound has a smaller o(n) term and it also has a simple and uniform o(n) time and space construction algorithm. We implement our data structure and Jacobson's, and evaluate their practical performance (speed and memory usage), when used in a succinct representation of large static XML documents. As a baseline, we compare our representations against a widely-used implementation of the standard DOM (Document Object Model) representation of XML documents. Both succinct representations use orders of magnitude less space than DOM, but are slightly slower and provide less functionality. © Springer-Verlag 2004.

Cite

CITATION STYLE

APA

Geary, R. F., Rahman, N., Raman, R., & Raman, V. (2004). A simple optimal representation for balanced parentheses. Lecture Notes in Computer Science (Including Subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics), 3109, 159–172. https://doi.org/10.1007/978-3-540-27801-6_12

Register to see more suggestions

Mendeley helps you to discover research relevant for your work.

Already have an account?

Save time finding and organizing research with Mendeley

Sign up for free