I receive a tree and suppose to output the same tree with the values negated: 1 becomes -1, -2 becomes 2, #t becomes #f and the opposite way.
The tree is flexible - each can have multiple sons, one or none. I'm not allowed to add user-defined helper procedures. However, I can use built-in (primitive) procedures: length, equal?, append, foldl, map, boolean?, not, take, last.
What I have so far is:
(define inverse-tree
(lambda (tree)
(cond ((eq? '() tree) '())
((pair? tree)
(make-tree (inverse-tree (car tree))
(inverse-tree (cdr tree))))
(else (tree)))))