이 문서는 Structure and Interpretation of Computer, by Abelson, Sussman, and Sussman의 라이센스 이용허가규약 저작자표시-비영리에 따라 제작된 문서입니다.
혼자 공부하면서 풀어본 것입니다. 그런만큼 틀린게 꽤 많을 것입니다. 문제 있는 부분은 알려주시면 고맙겠습니다.
혼자 공부하면서 풀어본 것입니다. 그런만큼 틀린게 꽤 많을 것입니다. 문제 있는 부분은 알려주시면 고맙겠습니다.
Exercise 1.9. Each of the
following two procedures defines a method for adding two positive integers
in terms of the procedures inc, which increments its argument
by 1, and dec, which decrements its argument by 1.
(define (+ a b)
(if (= a 0)
b
(inc (+ (dec a) b))))
(define (+ a b)
(if (= a 0)
b
(+ (dec a) (inc b))))
Using the substitution model, illustrate the process generated by each procedure in evaluating (+ 4 5). Are these processes iterative or recursive?
펼쳐두기..





의견을 달아 주세요
관리자의 승인을 기다리고 있는 댓글입니다