OFFSET
0,3
COMMENTS
This Catalan bijection rotates binary trees left, if possible, otherwise applies Catalan bijection A069767.
LINKS
A. Karttunen, Gatomorphisms (with the complete Scheme source)
PROG
(Scheme) ;; Functions implementing this automorphism on list-structures:
(define (gma082349! s) (cond ((pair? s) (cond ((pair? (cdr s)) (robl! s)) (else (gma069767! s))))) s)
(define (robl! s) (let ((ex-car (car s))) (set-car! s (cddr s)) (set-cdr! (cdr s) ex-car) (swap! (cdr s)) (swap! s) s))
(define (swap! s) (let ((ex-car (car s))) (set-car! s (cdr s)) (set-cdr! s ex-car) s))
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Apr 17 2003
STATUS
approved
