11 2024 档案
摘要:
从 2.83 开始我感觉做的有点怪怪的,我似乎没有很好地理解这些题目的目的,也没有在写完之后用测试样例监测,只是简单的实现了那个逻辑。所以做到练习 2.85 我已经不知道在干什么了,所以我决定重新写一遍,把实数这一层也加上,同时每道题目新增的过程都要有对应的测试样例。 结果写了两天也没写出来,参考别
阅读全文
![sicp每日一题[2.85-2.86]](https://img2024.cnblogs.com/blog/3223467/202411/3223467-20241123140717897-100215849.png)
摘要:
Exercise 2.84 Using the raise operation of Exercise 2.83, modify the apply-generic procedure so that it coerces its arguments to have the same type by
阅读全文
![sicp每日一题[2.84]](https://img2024.cnblogs.com/blog/3223467/202411/3223467-20241121084145994-343559728.png)
摘要:
Exercise 2.83 Suppose you are designing a generic arithmetic system for dealing with the tower of types shown in Figure 2.25: integer, rational, real,
阅读全文
![sicp每日一题[2.83]](https://img2024.cnblogs.com/blog/3223467/202411/3223467-20241120081014891-1932550145.png)
摘要:
Exercise 2.82 Show how to generalize apply-generic to handle coercion in the general case of multiple arguments. One strategy is to attempt to coerce
阅读全文
![sicp每日一题[2.82]](https://img2024.cnblogs.com/blog/3223467/202411/3223467-20241119085920173-2090800313.png)
摘要:
Exercise2.81 Louis Reasoner has noticed that apply-generic may try to coerce the arguments to each other’s type even if they already have the same typ
阅读全文
![sicp每日一题[2.81]](https://img2024.cnblogs.com/blog/3223467/202411/3223467-20241118083853772-452341284.png)
摘要:
Exercise 2.80 Define a generic predicate =zero? that tests if its argument is zero, and install it in the generic arithmetic package. This operation s
阅读全文
![sicp每日一题[2.80]](https://img2024.cnblogs.com/blog/3223467/202411/3223467-20241117085656108-1861597208.png)
摘要:
Exercise2.79 Define a generic equality predicate equ? that tests the equality of two numbers, and install it in the generic arithmetic package. This o
阅读全文
![sicp每日一题[2.79]](https://img2024.cnblogs.com/blog/3223467/202411/3223467-20241116132322207-941964768.png)
摘要:
Exercise2.78 The internal procedures in the scheme-number package are essentially nothing more than calls to the primitive procedures +, -, etc. It wa
阅读全文
![sicp每日一题[2.78]](https://img2024.cnblogs.com/blog/3223467/202411/3223467-20241115192441624-1893550806.png)
摘要:
Exercise 2.77 Louis Reasoner tries to evaluate the expression (magnitude z) where z is the object shown in Figure 2.24. To his surprise, instead of th
阅读全文
![sicp每日一题[2.77]](https://img2024.cnblogs.com/blog/3223467/202411/3223467-20241114193740574-1055991402.png)
摘要:
Exercise 2.76 As a large system with generic operations evolves, new types of data objects or new operations may be needed. For each of the three stra
阅读全文
![sicp每日一题[2.76]](https://img2024.cnblogs.com/blog/3223467/202411/3223467-20241113193009384-62323850.png)
摘要:
Exercise2.75 Implement the constructor make-from-mag-ang in message-passing style. This procedure should be an alogous to the make-from-real-imag proc
阅读全文
![sicp每日一题[2.75]](https://img2024.cnblogs.com/blog/3223467/202411/3223467-20241112195155247-627265426.png)
摘要:
Exercise 2.74 Insatiable Enterprises, Inc., is a highly decentralized conglomerate company consisting of a large number of independent divisions locat
阅读全文
![sicp每日一题[2.74]](https://img2024.cnblogs.com/blog/3223467/202411/3223467-20241111194254052-1565926261.png)
摘要:
最近状态不太好,再加上2.73前面的内容有点多,学的有点吃力,所以昨天就没做。。 Exercise 2.73 Section 2.3.2 described a program that performs symbolic differentiation: (define (deriv exp va
阅读全文
![sicp每日一题[2.73]](https://img2024.cnblogs.com/blog/3223467/202411/3223467-20241109222035779-1853664662.png)
摘要:
Exercise 2.72 Consider the encoding procedure that you designed in Exercise 2.68. What is the order of growth in the number of steps needed to encode
阅读全文
![sicp每日一题[2.72]](https://img2024.cnblogs.com/blog/3223467/202411/3223467-20241107184339183-1589569712.png)
摘要:
Exercise 2.71 Suppose we have a Huffman tree for an alphabet of n symbols, and that the relative frequencies of the symbols are 1,2,4, . . . ,2n 1. Sk
阅读全文
![sicp每日一题[2.71]](https://img2024.cnblogs.com/blog/3223467/202411/3223467-20241106220335444-504604830.png)
摘要:
Exercise 2.70 The following eight-symbol alphabet with associated relative frequencies was designed to efficiently encode the lyrics of 1950s rock son
阅读全文
![sicp每日一题[2.70]](https://img2024.cnblogs.com/blog/3223467/202411/3223467-20241105203710445-373726865.png)
摘要:
Exercise 2.69 The following procedure takes as its argument a list of symbol-frequency pairs (where no symbol appears in more than one pair) and gener
阅读全文
![sicp每日一题[2.69]](https://img2024.cnblogs.com/blog/3223467/202411/3223467-20241104195544482-97796252.png)
摘要:
Exercise 2.67 Define an encoding tree and a sample message: (define (make-leaf-set pairs) (if (null? pairs) '() (let ((pair (car pairs))) (adjoin-set
阅读全文
![sicp每日一题[2.67-2.68]](https://img2024.cnblogs.com/blog/3223467/202411/3223467-20241103085853336-952111968.png)
摘要:
Exercise 2.66 Implement the lookup procedure for the case where the set of records is structured as a binary tree, ordered by the numerical values of
阅读全文
![sicp每日一题[2.66]](https://img2024.cnblogs.com/blog/3223467/202411/3223467-20241102113059624-1460592812.png)
摘要:
Exercise 2.65 Use the results of Exercise 2.63 and Exercise 2.64 to give (n) implementations of union-set and intersection-set for sets implemented as
阅读全文
![sicp每日一题[2.65]](https://img2024.cnblogs.com/blog/3223467/202411/3223467-20241101084230040-1909568479.png)