合集-sicp

摘要: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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.42]这道题太难了,我自己只完成了 empty-board 这一个定义,其他的函数即使看了别人的答案也研究了半天才搞明白。。 ; board-size 指的是正方形棋盘的长 (define (queens board-size) (define (queen-cols k) (if (= k 0) (li 阅读全文
posted @ 2024-10-12 08:20 再思即可 阅读(5) 评论(0) 推荐(0) 编辑
摘要:sicp每日一题[2.43]Exercise 2.43 Louis Reasoner is having a terrible time doing Exercise 2.42. His queens procedure seems to work, but it runs extremely slowly. (Louis n 阅读全文
posted @ 2024-10-13 07:56 再思即可 阅读(8) 评论(0) 推荐(0) 编辑
摘要:sicp每日一题[2.44]我在这一章遇到了一个大问题,就是书上用的那些函数 beside, wave, flip-vert 我统统用不了。我用的是 DrRacket 这个软件,在网上查了半天,终于找到了解决办法。 首先是官方教程,在 DrRacket 中依次打开 File -> Package Manager...,在弹出的 阅读全文
posted @ 2024-10-14 08:21 再思即可 阅读(12) 评论(0) 推荐(0) 编辑

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