摘要: 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 再思即可 阅读(3) 评论(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 再思即可 阅读(3) 评论(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 再思即可 阅读(1) 评论(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 再思即可 阅读(2) 评论(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 再思即可 阅读(2) 评论(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 再思即可 阅读(5) 评论(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 再思即可 阅读(3) 评论(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 再思即可 阅读(1) 评论(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 再思即可 阅读(2) 评论(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 再思即可 阅读(4) 评论(0) 推荐(0) 编辑