Return all strings of n pairs of balanced parentheses, in lexicographic order ('(' before ')'). Use backtracking: add ( while you have some left, and ) only when it wouldn't close more than you've opened.
The number of results is the n-th Catalan number.