![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
sicp
文章平均质量分 90
iteye_15309
这个作者很懒,什么都没留下…
展开
-
Exercise 1.9
Exercise 1.9 写道Exercise 1.9. Each of the following two procedures defines a method for adding two positive integers interms of the procedures inc, which increments its argument by 1, and dec, w...原创 2013-05-28 17:32:07 · 115 阅读 · 0 评论 -
Fibonacci数列 与 Exercise 1.11
先看看SICP Exercise 1.11Exercise 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 mea...原创 2013-05-29 21:28:56 · 84 阅读 · 0 评论 -
Exercise 1.29 -- 辛普森积分法
来看看这道题: Exercise 1.29. 写道Simpson's Rule is a more accurate method of numerical integration than the methodillustrated above. Using Simpson's Rule, the integral of a function f between a and b ...原创 2013-06-07 01:11:28 · 396 阅读 · 0 评论 -
Exercise 1.30/1.31/1.32/1.33
1.30 Exercise 1.30. The sum procedure above generates a linear recursion. The procedure can be rewritten sothat the sum is performed iteratively. Show how to do this by filling in the missing ex...原创 2013-06-07 23:30:36 · 116 阅读 · 0 评论 -
Exercise 1.37
sicp的练习题1.37需要实现递归和非递归两个版本“连分数”计算黄金分割点的算法 连分数的介绍在这里, 它是一个类似于这样的分数: 如果连分数中的[a0, a1, a2...]均取1的话,这个分式的结果就是黄金分割点的值。 更一般的,我们把第k层的分子叫做N_k, 分母中左侧部分叫做D_k, 那应该有一个方法: cont-frac 这个方法有三个参数...2013-08-15 16:30:15 · 93 阅读 · 0 评论 -
Exercise 1.41 ~ 1.44
1.41定义一个 double 操作,用来将某个特定的操作重复两次。例如我们有一个inc的操作会将某个数值加1,那么(double inc)则会将数值加二。 最终需要计算这个值: 写道(((double (double double)) inc) 5) 下面是实现:(defun db (f) (lambda (x) (funcall f ...原创 2013-08-15 19:59:35 · 102 阅读 · 0 评论