// output of ./demo/comb/dyck-gray-demo.cc: // Description: //% Gray code for k-ary Dyck words with homogeneous transitions. //% Loopless algorithm following //% Dominique Roelants van Baronaigien: //% "A Loopless Gray-Code Algorithm for Listing k-ary Trees", //% Journal of Algorithms, vol.35, pp.100-107, (2000). arg 1: 4 == n [Number of ones in words.] default=4 arg 2: 3 == k [k-ary Dyck words (k>=2).] default=3 1: [ 1 4 7 A ] [ + + + + ] 1..1..1..1.. 2: [ 1 4 7 8 ] [ + + + + ] 1..1..11.... 3: [ 1 4 7 9 ] [ + + + - ] 1..1..1.1... 4: [ 1 4 5 9 ] [ + + + - ] 1..11...1... 5: [ 1 4 5 8 ] [ + + + - ] 1..11..1.... 6: [ 1 4 5 7 ] [ + + + - ] 1..11.1..... 7: [ 1 4 5 6 ] [ + + + - ] 1..111...... 8: [ 1 4 5 A ] [ + + + + ] 1..11....1.. 9: [ 1 4 6 A ] [ + + - + ] 1..1.1...1.. 10: [ 1 4 6 7 ] [ + + - + ] 1..1.11..... 11: [ 1 4 6 8 ] [ + + - + ] 1..1.1.1.... 12: [ 1 4 6 9 ] [ + + - - ] 1..1.1..1... 13: [ 1 2 6 9 ] [ + + - - ] 11...1..1... 14: [ 1 2 6 8 ] [ + + - - ] 11...1.1.... 15: [ 1 2 6 7 ] [ + + - - ] 11...11..... 16: [ 1 2 6 A ] [ + + - + ] 11...1...1.. 17: [ 1 2 5 A ] [ + + - + ] 11..1....1.. 18: [ 1 2 5 6 ] [ + + - + ] 11..11...... 19: [ 1 2 5 7 ] [ + + - + ] 11..1.1..... 20: [ 1 2 5 8 ] [ + + - + ] 11..1..1.... 21: [ 1 2 5 9 ] [ + + - - ] 11..1...1... 22: [ 1 2 4 9 ] [ + + - - ] 11.1....1... 23: [ 1 2 4 8 ] [ + + - - ] 11.1...1.... 24: [ 1 2 4 7 ] [ + + - - ] 11.1..1..... 25: [ 1 2 4 6 ] [ + + - - ] 11.1.1...... 26: [ 1 2 4 5 ] [ + + - - ] 11.11....... 27: [ 1 2 4 A ] [ + + - + ] 11.1.....1.. 28: [ 1 2 3 A ] [ + + - + ] 111......1.. 29: [ 1 2 3 4 ] [ + + - + ] 1111........ 30: [ 1 2 3 5 ] [ + + - + ] 111.1....... 31: [ 1 2 3 6 ] [ + + - + ] 111..1...... 32: [ 1 2 3 7 ] [ + + - + ] 111...1..... 33: [ 1 2 3 8 ] [ + + - + ] 111....1.... 34: [ 1 2 3 9 ] [ + + - - ] 111.....1... 35: [ 1 2 7 9 ] [ + + + - ] 11....1.1... 36: [ 1 2 7 8 ] [ + + + - ] 11....11.... 37: [ 1 2 7 A ] [ + + + + ] 11....1..1.. 38: [ 1 3 7 A ] [ + - + + ] 1.1...1..1.. 39: [ 1 3 7 8 ] [ + - + + ] 1.1...11.... 40: [ 1 3 7 9 ] [ + - + - ] 1.1...1.1... 41: [ 1 3 4 9 ] [ + - + - ] 1.11....1... 42: [ 1 3 4 8 ] [ + - + - ] 1.11...1.... 43: [ 1 3 4 7 ] [ + - + - ] 1.11..1..... 44: [ 1 3 4 6 ] [ + - + - ] 1.11.1...... 45: [ 1 3 4 5 ] [ + - + - ] 1.111....... 46: [ 1 3 4 A ] [ + - + + ] 1.11.....1.. 47: [ 1 3 5 A ] [ + - + + ] 1.1.1....1.. 48: [ 1 3 5 6 ] [ + - + + ] 1.1.11...... 49: [ 1 3 5 7 ] [ + - + + ] 1.1.1.1..... 50: [ 1 3 5 8 ] [ + - + + ] 1.1.1..1.... 51: [ 1 3 5 9 ] [ + - + - ] 1.1.1...1... 52: [ 1 3 6 9 ] [ + - - - ] 1.1..1..1... 53: [ 1 3 6 8 ] [ + - - - ] 1.1..1.1.... 54: [ 1 3 6 7 ] [ + - - - ] 1.1..11..... 55: [ 1 3 6 A ] [ + - - + ] 1.1..1...1.. ct=55