您确实需要提供更多信息,例如您对“树”的表示是什么,以及如何定义和处理缺少其“左”或“右”子节点的树。
(define (make-tree value left right)
`(TREE ,value ,left ,right))
(define value cadr)
(define right caddr)
(define left cadddr)
;; How is an 'empty' tree denoted?
(define empty 'EMPTY)
(define (is-empty? tree)
(eq? tree empty))
(define (make-leaf value)
(make-tree value empty empty))
;; Now you have the basis for a solution; here is a start.
(define (right-rotate tree)
(if (is-empty? tree)
empty
(let ((l (left tree)))
(if (is-empty? l)
<something>
(make-tree (value l)
(left l)
(make-tree (value tree) (right l) (right tree)))))))