<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    Exercise 1.11.  A function f is defined by the rule that f(n) = n if n<3 and f(n) = f(n - 1) + 2f(n - 2) + 3f(n - 3) if n> 3. Write a procedure that computes f by means of a recursive process. Write a procedure that computes f by means of an iterative process.

    recursive:

    (define (fn n)
      (cond ((>= n 3) (+ (+ (fn (- n 1)) (* 2 (fn (- n 2)))) (* 3 (fn (- n 3)))))
            ((< n 3) n)
       ))


     iterative:

    (define (re n)
      (if (< n 3)
          n
          (iter 2 1 0 n)
          ))
    (define (iter a b c n)
    (if(= n 3)
       (ca a b c)
       (iter (ca a b c) a b (- n 1))
       )
    )
    (define (ca a b c)
      (+ a (* 2 b) (* 3 c) )
    )

    posted on 2009-03-10 08:51 lzj520 閱讀(212) 評論(0)  編輯  收藏 所屬分類: 個(gè)人學(xué)習(xí)日記sicp
    主站蜘蛛池模板: 亚洲精品美女久久久久99小说| 97免费人妻无码视频| 又粗又硬又大又爽免费视频播放| 亚洲伊人久久精品| 国产91免费视频| 亚洲成a人片77777群色| 最近免费中文字幕大全免费版视频| 亚洲欧洲免费视频| 中文字幕免费在线| 亚洲精品亚洲人成在线播放| 美女视频黄的全免费视频网站| jiz zz在亚洲| 免费国产美女爽到喷出水来视频| 国产亚洲精品91| 国产亚洲精品不卡在线| 免费国产叼嘿视频大全网站| 亚洲色图在线观看| 女人18毛片a级毛片免费视频| 亚洲AV第一成肉网| 亚洲精品456播放| 免费人成在线观看网站| 亚洲精品中文字幕乱码影院| 久久精品女人天堂AV免费观看| 亚洲αⅴ无码乱码在线观看性色| 亚洲成av人片一区二区三区 | 成人黄18免费视频| 男男黄GAY片免费网站WWW| 久久久久亚洲精品无码网址| 一级毛片在线免费看| 亚洲色欲色欱wwW在线| 亚洲第一区精品日韩在线播放| 叮咚影视在线观看免费完整版| 亚洲网站视频在线观看| 国产美女无遮挡免费网站| 女同免费毛片在线播放| 亚洲人成未满十八禁网站| 亚洲中文字幕无码专区| 久久久久久精品成人免费图片| 国产成人 亚洲欧洲| 亚洲精品综合一二三区在线| 免费特级黄毛片在线成人观看|