10 2024 档案

摘要:sicp每日一题[2.63-2.64]Exercise 2.63 Each of the following two procedures converts a binary tree to a list. (define (tree->list-1 tree) (if (null? tree) '() (append (tree->l 阅读全文
posted @ 2024-10-31 08:40 再思即可 阅读(5) 评论(0) 推荐(0) 编辑
摘要:sicp每日一题[2.62]Exercise 2.62 Give a (n) implementation of union-set for sets represented as ordered lists. 这道题难度也不大,思路是依次从两个集合中取第一个元素,比较他们的大小,把小的那个和剩下所有元素连接的结果连接起来。由 阅读全文
posted @ 2024-10-30 08:07 再思即可 阅读(3) 评论(0) 推荐(0) 编辑
摘要:sicp每日一题[2.61]Exercise 2.61 Give an implementation of adjoin-set using the ordered representation. By analogy with element-of-set? show how to take advantage of the 阅读全文
posted @ 2024-10-29 08:17 再思即可 阅读(6) 评论(0) 推荐(0) 编辑
摘要:sicp每日一题[2.60]Exercise2.60 We specified that a set would be represented as a list with no duplicates. Now suppose we allow duplicates. For instance, the set {1, 2, 阅读全文
posted @ 2024-10-28 08:40 再思即可 阅读(5) 评论(0) 推荐(0) 编辑
摘要:sicp每日一题[2.59]Exercise 2.59 Implement the union-set operation for the unordered-list representation of sets. 这道题很简单,仿照 intersection-set 稍作修改就可以实现了 (define (union-se 阅读全文
posted @ 2024-10-27 09:09 再思即可 阅读(9) 评论(0) 推荐(0) 编辑
摘要:sicp每日一题[2.58]Exercise 2.58 Suppose we want to modify the differentiation program so that it works with ordinary mathematical notation, in which + and * are infix r 阅读全文
posted @ 2024-10-26 13:16 再思即可 阅读(17) 评论(0) 推荐(0) 编辑
摘要:sicp每日一题[2.57]Exercise 2.57 Extend the differentiation program to handle sums and products of arbitrary numbers of (two or more) terms. Then the last example above 阅读全文
posted @ 2024-10-25 08:30 再思即可 阅读(10) 评论(0) 推荐(0) 编辑
摘要:sicp每日一题[2.56]Exercise 2.56 Show how to extend the basic differentiator to handle more kinds of expressions. For instance, implement the differentiation rule d(x^n) 阅读全文
posted @ 2024-10-24 08:20 再思即可 阅读(9) 评论(0) 推荐(0) 编辑
摘要:sicp每日一题[2.53-2.55]2.53不用写代码,2.54和2.55属于一道题,所以就放到一起吧 Exercise2.53 What would the interpreter print in response to evaluating each of the following expressions? (list 'a 阅读全文
posted @ 2024-10-23 08:24 再思即可 阅读(11) 评论(0) 推荐(0) 编辑
摘要:sicp每日一题[2.52]Exercise 2.52 Make changes to the square limit of wave shown in Figure 2.9 by working at each of the levels described above. In particular: a. Add som 阅读全文
posted @ 2024-10-22 10:44 再思即可 阅读(12) 评论(0) 推荐(0) 编辑
摘要:sicp每日一题[2.51]Exercise2.51 Define the below operation for painters. below takes two painters as arguments. The resulting painter, given a frame, draws with the firs 阅读全文
posted @ 2024-10-21 08:46 再思即可 阅读(7) 评论(0) 推荐(0) 编辑
摘要:sicp每日一题[2.50]Exercise 2.50 Define the transformation flip-horiz, which flips painters horizontally, and transformations that rotate painters counterclockwise by 18 阅读全文
posted @ 2024-10-20 09:12 再思即可 阅读(8) 评论(0) 推荐(0) 编辑
摘要:sicp每日一题[2.49]Exercise 2.49 Use segments->painter to define the following primitive painters: a. The painter that draws the outline of the designated frame. b. The 阅读全文
posted @ 2024-10-19 12:45 再思即可 阅读(15) 评论(0) 推荐(0) 编辑
摘要:sicp每日一题[2.48]Exercise 2.48 A directed line segment in the plane can be represented as a pair of vectors—the vector running from the origin to the start-point of th 阅读全文
posted @ 2024-10-18 08:53 再思即可 阅读(6) 评论(0) 推荐(0) 编辑
摘要:sicp每日一题[2.47]Exercise 2.47 Here are two possible constructors for frames: (define (make-frame origin edge1 edge2) (list origin edge1 edge2)) (define (make-frame or 阅读全文
posted @ 2024-10-17 08:40 再思即可 阅读(4) 评论(0) 推荐(0) 编辑
摘要:sicp每日一题[2.46]Exercise 2.46 A two-dimensional vector v running from the origin to a point can be represented as a pair consisting of an x-coordinate and a y-coordin 阅读全文
posted @ 2024-10-16 08:35 再思即可 阅读(7) 评论(0) 推荐(0) 编辑
摘要:sicp每日一题[2.45]right-split and up-split can be expressed as instances of a general splitting operation. Define a procedure split with the property that evaluating (d 阅读全文
posted @ 2024-10-15 08:21 再思即可 阅读(7) 评论(0) 推荐(0) 编辑
摘要:sicp每日一题[2.44]我在这一章遇到了一个大问题,就是书上用的那些函数 beside, wave, flip-vert 我统统用不了。我用的是 DrRacket 这个软件,在网上查了半天,终于找到了解决办法。 首先是官方教程,在 DrRacket 中依次打开 File -> Package Manager...,在弹出的 阅读全文
posted @ 2024-10-14 08:21 再思即可 阅读(11) 评论(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 再思即可 阅读(6) 评论(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 再思即可 阅读(4) 评论(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 再思即可 阅读(6) 评论(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 再思即可 阅读(8) 评论(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 再思即可 阅读(2) 评论(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 再思即可 阅读(4) 评论(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 再思即可 阅读(4) 评论(0) 推荐(0) 编辑

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