题目
题目

CPT_S-355-PULLM-1-LEC Scheduled Quiz 1

单项选择题

Given the following definition of 'sqr' and 'res1' How many times was 'sqr' called to compute 'res1'? Note: 'even' is an inbuilt function which returns true if the argument is an even number

选项
A.8
B.20
C.2
D.4
题目图片
查看解析

查看解析

标准答案
Please login to view
思路分析
We’re given a lazy evaluation expression: take 4 (map sqr (filter even [1 ..])) and asked how many times sqr is called to compute res1. Option 1: 8 Reasoning: If you think in terms of how many input numbers are inspected, you may assume the filter needs 8 inputs to produce 4 evens. However, the questio......Login to view full explanation

登录即可查看完整答案

我们收录了全球超50000道考试原题与详细解析,现在登录,立即获得答案。

类似问题

更多留学生实用工具

加入我们,立即解锁 海量真题独家解析,让复习快人一步!