码迷,mamicode.com
首页 >  
搜索关键字:sicp    ( 322个结果
【SICP练习】136 练习3.67
练习3-67原文Exercise 3.67. Modify the pairs procedure so that (pairs integers integers) will produce the stream of all pairs of integers (i,j) (without the condition i < j). Hint: You will need to mix in...
分类:其他好文   时间:2015-03-29 10:55:03    阅读次数:160
【SICP练习】137 练习3.68
练习3-68原文Exercise 3.68. Louis Reasoner thinks that building a stream of pairs from three parts is unnecessarily complicated. Instead of separating the pair (S0,T0) from the rest of the pairs in the fir...
分类:其他好文   时间:2015-03-29 10:52:16    阅读次数:136
【SICP练习】138 练习3.69
练习3-69原文代码 (define (triples s t u) (cons-stream (list (stream-car s) (stream-car t) (stream-car u)) (interleave (stream-map (lambda (x) (cons (stream-car s)...
分类:其他好文   时间:2015-03-29 10:50:16    阅读次数:118
【SICP练习】139 练习3.70
练习3-70原文代码(define (merge-weighted s1 s2 weight) (cond ((stream-null? s1) s2) ((stream-null? s2) s1) (else (let ((cars1 (stream-car s1)) (cars2 (stream-car s2))) (cond (...
分类:其他好文   时间:2015-03-29 10:50:12    阅读次数:132
SICP:求函数的不定点来实现开平方根(由于使用平均阻尼技术,过程类似牛顿开平方根,以及求黄金分割率)
#lang racket(define tolerance 0.00001);公差(define (fixed-point f first-guess) (define (close-enough? v1 v2) (< (abs (- v1 v2)) tolerance) );clos...
分类:其他好文   时间:2015-03-29 10:40:43    阅读次数:142
【SICP练习】133 练习3.64
练习3-64原文Exercise 3.64. Write a procedure stream-limit that takes as arguments a stream and a number (the tolerance). It should examine the stream until it finds two successive elements that differ in...
分类:其他好文   时间:2015-03-29 09:31:45    阅读次数:133
【SICP练习】134 练习3.65
练习3-65原文Exercise 3.65. Use the series ln2 = 1- 1/2 + 1/3 - 1/4 + …… to compute three sequences of approximations to the natural logarithm of 2, in the same way we did above for . How rapidly do the...
分类:其他好文   时间:2015-03-29 09:30:17    阅读次数:165
【SICP练习】122 练习3.53
练习3-53原文Exercise 3.53. Without running the program, describe the elements of the stream defined by (define s (cons-stream 1 (add-streams s s)))分析s是一串2的幂。也就是1、2、4、8、16、32……...
分类:其他好文   时间:2015-03-28 23:19:56    阅读次数:396
【SICP练习】128 练习3.59
练习3-59原文 代码a)(define (integrate-series s) (stream-map * (stream-map / ones integers) s))b)(define sine-series (cons-stream 0 (integrate-series cosine-series))) (define cosine-series (con...
分类:其他好文   时间:2015-03-28 23:19:21    阅读次数:387
【SICP练习】130 练习3.61
练习3-61原文 代码(define (reciprocal-series s) (cons-stream 1 (scale-stream (mul-series (stream-cdr s) (reciprocal-series s))...
分类:其他好文   时间:2015-03-28 23:17:09    阅读次数:155
322条   上一页 1 ... 13 14 15 16 17 ... 33 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!