随笔分类 -  sicp

摘要:sicp每日一题[2.41]Exercise 2.41 Write a procedure to find all ordered triples of distinct positive integers i, j, and k less than or equal to a given integer n that sum 阅读全文
posted @ 2024-10-11 08:23 再思即可 阅读(8) 评论(0) 推荐(0) 编辑
摘要:sicp每日一题[2.40]Exercise2.40 Define a procedure unique-pairs that, given an integer n, generates the sequence of pairs (i, j) with 1 < j < i < n. Use unique-pairs to 阅读全文
posted @ 2024-10-10 08:38 再思即可 阅读(9) 评论(0) 推荐(0) 编辑
摘要:sicp每日一题[2.38-2.39]Exercise 2.38 The accumulate procedure is also known as fold-right, because it combines the first element of the sequence with the result of combining 阅读全文
posted @ 2024-10-09 09:01 再思即可 阅读(3) 评论(0) 推荐(0) 编辑
摘要:sicp每日一题[2.36-2.37]果然习惯不能停,就两天没学,昨天就忘的干干净净了。。今天把昨天的补上 Exercise 2.36 The procedure accumulate-n is similar to accumulate except that it takes as its third argument a sequ 阅读全文
posted @ 2024-10-08 11:25 再思即可 阅读(5) 评论(0) 推荐(0) 编辑
摘要:sicp每日一题[2.35]十一去喀纳斯玩了2天,今天恢复,才几天没看书再看到代码就感到有点陌生了。。 Exercise 2.35 Redefine count-leaves from Section 2.2.2 as an accumulation: (define (count-leaves t) (accumulate 阅读全文
posted @ 2024-10-06 21:30 再思即可 阅读(5) 评论(0) 推荐(0) 编辑
摘要:sicp每日一题[2.34]Exercise 2.34 Evaluating a polynomial in x at a given value of x can be formulated as an accumulation. We evaluate the polynomial an x^n + a{n-1} x^(n 阅读全文
posted @ 2024-09-30 17:04 再思即可 阅读(6) 评论(0) 推荐(0) 编辑
摘要:sicp每日一题[2.33]Exercise 2.33 Fill in the missing expressions to complete the following definitions of some basic list-manipulation operations as accumulations: ; p 表 阅读全文
posted @ 2024-09-29 08:27 再思即可 阅读(7) 评论(0) 推荐(0) 编辑
摘要:sicp每日一题[2.32]上一道题没什么改动,再来一道 Exercise 2.32 We can represent a set as a list of distinct elements, and we can represent the set of all subsets of the set as a list o 阅读全文
posted @ 2024-09-28 08:40 再思即可 阅读(3) 评论(0) 推荐(0) 编辑
摘要:sicp每日一题[2.31]Exercise 2.31 Abstract your answer to Exercise 2.30 to produce a procedure $tree-map$ with the property that $square-tree$ could be defined as (define 阅读全文
posted @ 2024-09-28 08:37 再思即可 阅读(4) 评论(0) 推荐(0) 编辑
摘要:sicp每日一题[2.30]Exercise 2.30 Define a procedure square-tree analogous to the square-list procedure of Exercise 2.21. That is, square-tree should behave as follows: ( 阅读全文
posted @ 2024-09-27 08:13 再思即可 阅读(6) 评论(0) 推荐(0) 编辑
摘要:sicp每日一题[2.29]Exercise 2.29 A binary mobile consists of two branches, a left branch and a right branch. Each branch is a rod of a certain length, from which hangs e 阅读全文
posted @ 2024-09-26 12:07 再思即可 阅读(9) 评论(0) 推荐(0) 编辑
摘要:sicp每日一题[2.28]Exercise2.28 Write a procedure fringe that takes as argument a tree (represented as a list) and returns a list whose elements are all the leaves of th 阅读全文
posted @ 2024-09-25 11:21 再思即可 阅读(4) 评论(0) 推荐(0) 编辑
摘要:sicp每日一题[2.24-2.27]2.24-2.26没什么代码量,所以跟 2.27 一起发吧。 Exercise 2.24 Suppose we evaluate the expression (list 1 (list 2 (list 3 4))). Give the result printed by the interpret 阅读全文
posted @ 2024-09-24 10:40 再思即可 阅读(12) 评论(0) 推荐(0) 编辑
摘要:sicp每日一题[2.22-2.23]Exercise2.22 Louis Reasoner tries to rewrite the first square-list procedure of Exercise 2.21 so that it evolves an iterative process: (define (square 阅读全文
posted @ 2024-09-23 10:59 再思即可 阅读(7) 评论(0) 推荐(0) 编辑
摘要:sicp每日一题[2.21]Exercise 2.21 The procedure square-list takes a list of numbers as argument and returns a list of the squares of those numbers. (square-list (list 1 2 阅读全文
posted @ 2024-09-22 08:34 再思即可 阅读(6) 评论(0) 推荐(0) 编辑
摘要:sicp每日一题[2.20]Exercise 2.20 The procedures +, *, and list take arbitrary numbers of arguments. One way to define such procedures is to use define with dotted-tail n 阅读全文
posted @ 2024-09-21 11:40 再思即可 阅读(13) 评论(0) 推荐(0) 编辑
摘要:sicp每日一题[2.19]Exercise 2.19 Consider the change-counting program of Section 1.2.2. It would be nice to be able to easily change the currency used by the program, so 阅读全文
posted @ 2024-09-20 08:03 再思即可 阅读(9) 评论(0) 推荐(0) 编辑
摘要:sicp每日一题[2.18]Exercise 2.18 Define a procedure reverse that takes a list as argument and returns a list of the same elements in reverse order: (reverse (list 1 4 9 阅读全文
posted @ 2024-09-19 10:26 再思即可 阅读(6) 评论(0) 推荐(0) 编辑
摘要:sicp每日一题[2.17]Exercise 2.17 Define a procedure last-pair that returns the list that contains only the last element of a given (nonempty) list: (last-pair (list 23 7 阅读全文
posted @ 2024-09-18 14:02 再思即可 阅读(11) 评论(0) 推荐(0) 编辑
摘要:sicp每日一题[2.13-2.16]Exercise 2.13 Show that under the assumption of small percentage tolerances there is a simple formula for the approximate percentage tolerance of the 阅读全文
posted @ 2024-09-17 13:20 再思即可 阅读(26) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示