【发布时间】:2020-06-22 17:25:54
【问题描述】:
我在调试这段代码时遇到了困难,希望有人能够帮助处理伪代码或类似问题的示例。提前谢谢你!
定义一个非递归Scheme过程(remove-them2 lst n),它返回lst中所有未出现在列表n中的元素的列表。
这是我目前所拥有的:
(define (remove-them2 lst n)
(if (null? lst)
n
(let ((tail (remove-them2 cons((cdr lst) (cdr n)))))
(if (member (car lst) (car n) tail)
tail
(cons (car lst) (car n) tail)))))
【问题讨论】:
-
这看起来是递归的。
remove-them2致电remove-them2。