© 1983 by British Computer Society
A Note on Generating Well-formed Parenthesis Strings Lexicographically
Department of Computing Sciences, The University of Wollongong, P.O. Box 1144, Wollongong, Australia
An efficient recursive algorithm for generating well-formed parenthesis strings lexicographically is shown. This algorithm can be easily adapted to generate stack-sortable permutations without changing the main control structures of the algorithm. The connection between well-formed parenthesis strings and ordered trees is also illustrated.
Received August 1982.
* Department of Computing Sciences, The University of Wollongong, P.O. Box 1144, Wollongong, NSW 2500, Australia