Longest segment of balanced parentheses -- an exercise in program inversion in a segment problem (Functional Pearl).
2021
Given a string of parentheses, the task is to find a longest consecutive segment that is properly bracketed. We find it an interesting problem because it involves two techniques: the usual approach for solving segment problems, and the converse-of-a-function theorem -- through which we derived an instance of shift-reduce parsing.
- Correction
- Source
- Cite
- Save
- Machine Reading By IdeaReader
7
References
0
Citations
NaN
KQI