当前位置:高等教育资讯网  >  中国高校课件下载中心  >  大学文库  >  浏览文档

《Structure and Interpretation of Computer Programs》q2 solns post

资源类别:文库,文档格式:PDF,文档页数:4,文件大小:66.88KB,团购合买
Depart ment of Electrical Engineering and Computer Science 01-Structure and Interpret at ion of Computer Programs Spring Semester, 2005 Quiz it NAME: Sample Solutions Part 1:(25 points)
点击下载完整版文档(PDF)

MASSACHVSETTS INSTITVTE OF TECHNOLOGY Depart ment of Electrical Engineering and Computer Science 01-Structure and Interpret at ion of Computer Programs Spring Semester, 2005 Quiz it NAME: Sample Solutions Part 1:(25 points) Question 1 (define (rotate-left cycle) (cdr cycle)) Question 2: (define (rotate-right cycle) (define (aux where start (if (eq? (cdr where)start) where Caux (cdr where) start))) (aux cycle cycle)) Question 3: (define (insert-cycle! new cycle) et ((new-cell (list new )) (set-cdr! new-cell cycle) (set-cdr! (rotate-right cycle) new-cell) 'done)) Question 4 (define (delete-cycle! cycle) (set-cdr! (rotate-right cycle)(rotate-left cycle) set-cdr! cycle’( done) Part 2: (30 points

￾             !""￾#     $%  %& '""( ￾  )          ￾   ￾ ￾    ￾   ￾   ￾ ￾    ￾ ￾     ￾ ￾ ￾      ￾  ￾     ￾   ￾   ￾ ￾    ￾  ￾￾ ￾   ￾    ￾  ￾       ￾   ￾ ￾    ￾  ￾    ￾    ￾  ￾       ￾  

6.001, Spring Semester, 2005--Quiz II Enclosing eny ironment E1 E2 E2 GE E3 GE E4 E1 Question 6: Environment Value to which bound etI -start GE Pl set!-careful I GE E2 5 GE E4 (10) act ion new E P4 current E 10 Question 7 location:卫2 value (5) Part 3(15 points) Question 8:A Question 9: K Question 10: H Question 1l: G Question 12: J Part 4 30 points

￾       ' % * ￾  '  +  ,  ￾   - *   .// - %01%   %01   * '     . ,   ,  * +  * +   ￾  ￾   )  *)       ￾   ￾  ! " ￾   # ￾    ￾   $     

6.001, Spring Semester, 2005--Quiz Il Ques Question 14. SHeETs (lambda o (fold-right +0 map (lambda (thing)(ask thing ' SHEETS)) Question 1 110 Question 17 Question 18. Question 19 (define (aged-cabinet self name) (let ((cabinet-part(cabinet self name Cage 0)) (make-handler ADD-THING (lambda (thing) (if (< age 4) (ask cabinet-part 'ADdThING thing (set! age ( age 1))) 'broken))) cabinet -part))) Question 20: (define (located-cabinet self name x y) (let((cabinet -part (cabinet self name)) (located-object-part (located-object self x y))) (make-handler (make-methods cabinet -part located-ob ject -part)))

￾       + ￾  %  ￾  %  & ' ￾  % ￾               ￾   ￾  %  ￾  %  ￾  %  ￾  !                    ￾     ￾     !"  #      ￾  $    % ￾     ￾            & '           (    (  & '   ￾           (

(ceefinrcta-nIc ly)loi gehu x wts ga Question 21 Sanpl em Sewo Ser 4)any ( My ann(rn3: n4 c: n3lee CQp Sn40 anc(eesnl jec(s)nR CAe(sx! 3ewoc Question 22 No QuzIsXsY! Sanpl emS3ewx 3ewyo Sn40 4eat CAe(sx! 3ewxo Sn0 4eat CAe(sy! 3ewyoo

￾       , ￾     )  ' **+'      ,￾￾     ( ￾&$ ) ￾   () ￾-.$   )& )'   ￾&$ )&   ￾'$ )'

点击下载完整版文档(PDF)VIP每日下载上限内不扣除下载券和下载次数;
按次数下载不扣除下载券;
24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
已到末页,全文结束
相关文档

关于我们|帮助中心|下载说明|相关软件|意见反馈|联系我们

Copyright © 2008-现在 cucdc.com 高等教育资讯网 版权所有