// output of ./demo/comb/catalan-rgs-subset-lex-demo.cc: // Description: //% Catalan restricted growth strings (RGS): //% strings a[0,1,...,n-1] where a[0]=0 and a[k] <= a[k-1] + 1. //% Subset-lex order. arg 1: 5 == n [Number of paren pairs] default=5 arg 2: 0 == bw [Whether to generate backward order] default=0 1: [ . . . . . ] 1 1.1.1.1.1. ()()()()() 2: [ . 1 . . . ] 1 11..1.1.1. (())()()() 3: [ . 1 1 . . ] 2 11.1..1.1. (()())()() 4: [ . 1 2 . . ] 2 111...1.1. ((()))()() 5: [ . 1 2 1 . ] 3 111..1..1. ((())())() 6: [ . 1 2 2 . ] 3 111.1...1. ((()()))() 7: [ . 1 2 3 . ] 3 1111....1. (((())))() 8: [ . 1 2 3 1 ] 4 1111...1.. (((()))()) 9: [ . 1 2 3 2 ] 4 1111..1... (((())())) 10: [ . 1 2 3 3 ] 4 1111.1.... (((()()))) 11: [ . 1 2 3 4 ] 4 11111..... ((((())))) 12: [ . 1 2 2 1 ] 4 111.1..1.. ((()())()) 13: [ . 1 2 2 2 ] 4 111.1.1... ((()()())) 14: [ . 1 2 2 3 ] 4 111.11.... ((()(()))) 15: [ . 1 2 1 1 ] 4 111..1.1.. ((())()()) 16: [ . 1 2 1 2 ] 4 111..11... ((())(())) 17: [ . 1 2 . 1 ] 4 111...11.. ((()))(()) 18: [ . 1 1 1 . ] 3 11.1.1..1. (()()())() 19: [ . 1 1 2 . ] 3 11.11...1. (()(()))() 20: [ . 1 1 2 1 ] 4 11.11..1.. (()(())()) 21: [ . 1 1 2 2 ] 4 11.11.1... (()(()())) 22: [ . 1 1 2 3 ] 4 11.111.... (()((()))) 23: [ . 1 1 1 1 ] 4 11.1.1.1.. (()()()()) 24: [ . 1 1 1 2 ] 4 11.1.11... (()()(())) 25: [ . 1 1 . 1 ] 4 11.1..11.. (()())(()) 26: [ . 1 . 1 . ] 3 11..11..1. (())(())() 27: [ . 1 . 1 1 ] 4 11..11.1.. (())(()()) 28: [ . 1 . 1 2 ] 4 11..111... (())((())) 29: [ . 1 . . 1 ] 4 11..1.11.. (())()(()) 30: [ . . 1 . . ] 2 1.11..1.1. ()(())()() 31: [ . . 1 1 . ] 3 1.11.1..1. ()(()())() 32: [ . . 1 2 . ] 3 1.111...1. ()((()))() 33: [ . . 1 2 1 ] 4 1.111..1.. ()((())()) 34: [ . . 1 2 2 ] 4 1.111.1... ()((()())) 35: [ . . 1 2 3 ] 4 1.1111.... ()(((()))) 36: [ . . 1 1 1 ] 4 1.11.1.1.. ()(()()()) 37: [ . . 1 1 2 ] 4 1.11.11... ()(()(())) 38: [ . . 1 . 1 ] 4 1.11..11.. ()(())(()) 39: [ . . . 1 . ] 3 1.1.11..1. ()()(())() 40: [ . . . 1 1 ] 4 1.1.11.1.. ()()(()()) 41: [ . . . 1 2 ] 4 1.1.111... ()()((())) 42: [ . . . . 1 ] 4 1.1.1.11.. ()()()(()) ct=42