摘要:
2.42 尚未理解书上的queens函数 参考代码 阅读全文
摘要:
1 #lang racket 2 3 ;;;;;;;;;;;;;;;;;2.40 4 (define nil '()) 5 6 (define (accumulate op intial seq) 7 (if (null? seq) 8 intial 9 (op (car seq) 10 (accumulate op inti... 阅读全文
摘要:
终于会一点了 需要复习线性代数了,感觉白学了! 阅读全文
摘要:
在SICP这几节中加深对cons和list的理解的句子: 1.nil的值表示序对的链结束,它也可以当做一个不包含任何元素的序列,空表。 2.利用序对可以构造出的有用结构是序列——一批数据对象的有序汇集。 3.在本书中我们用术语表专指那些有表尾结束标记的序对的链。与此相对应,用术语表结构指所有由序对构 阅读全文
摘要:
这一次的习题让我发现对cons和list的理解完全不是那么回事 参考资料 阅读全文
摘要:
1 #lang racket 2 3 ;;;;;;;;;;;;;;;;;;;2.21 4 (define (square-list items) 5 (if (null? items) 6 null 7 (cons (square (car items)) 8 (square-list (cdr items))))) 9 ... 阅读全文
摘要:
#lang racket ;;;;;;;;;;;;;;;;;;;;;;;;2.17 (define (last-pair L) (if (null? (cdr L)) L (last-pair (cdr L)))) ;;;;;;;;;;;;;;;;;;;;;;;2.18 (define (reverse L) (if (null? (cdr L)) ... 阅读全文
摘要:
1 (require "sicp_2.7-2.11.rkt") 2 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2.12 3 (define (make-center-width c w) 4 (make-interval (- c w) (+ c w))) 5 6 (define (make-center-percent c p) 7 (let... 阅读全文
摘要:
1 #include "stdio.h" 2 #include "stdlib.h" 3 4 /*int main(void) 5 { 6 char ch; 7 8 ch=getchar(); 9 putchar(ch); 10 } 11 */ 12 13 /*int main(void) 14 { 15 ... 阅读全文
摘要:
(define (make-interval x y) (cons x y)) (define (add-interval x y) (make-interval (+ (lower-bound x) (lower-bound y)) (+ (upper-bound x) (upper-bound y)))) ;;;;;;;;;;;;;;;2.7 ... 阅读全文