Questions
Questions

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

Single choice

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

Options
A.8
B.20
C.2
D.4
Question Image
View Explanation

View Explanation

Verified Answer
Please login to view
Step-by-Step Analysis
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

Log in for full answers

We've collected over 50,000 authentic exam questions and detailed explanations from around the globe. Log in now and get instant access to the answers!

Similar Questions

More Practical Tools for Students Powered by AI Study Helper

Join us and instantly unlock extensive past papers & exclusive solutions to get a head start on your studies!