SICP 연습문제 1.9 풀이

Universal Machine/SICP | 2008/12/18 21:47 | The Doctor
이 문서는 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?





펼쳐두기..

의견을 달아 주세요

  1. One_Egg 2010/03/16 20:17 수정삭제

    관리자의 승인을 기다리고 있는 댓글입니다

트랙백 주소 :: http://doctor.tardis.me/11/trackback/
옵션
댓글 달기
이전 1 ... 4 5 6 7 8 9 10 11 12 ... 16 다음