Back to Search
Start Over
Longest segment of balanced parentheses -- an exercise in program inversion in a segment problem (Functional Pearl)
- Publication Year :
- 2021
-
Abstract
- Given a string of parentheses, the task is to find the longest consecutive segment that is balanced, in linear time. We find this problem interesting because it involves a combination of techniques: the usual approach for solving segment problems, and a theorem for constructing the inverse of a function -- through which we derive an instance of shift-reduce parsing.
- Subjects :
- Computer Science - Programming Languages
Subjects
Details
- Database :
- arXiv
- Publication Type :
- Report
- Accession number :
- edsarx.2101.09699
- Document Type :
- Working Paper