Question: Assume the following function definitions exist: nmap f [ ] = [ ] nmap nmap f s nfilter f [ ] = [ ] nfilter

Assume the following function definitions exist:
nmap f[]=[]
nmap nmap fs
nfilter f[]=[]
nfilter f(x:xs)= if (f,x) then (x : (nfilter f xs ))
else (nfilter f xs)
reduce fs[]=s
reduce fs(x:xs)=f(reduce fss)
for mn f s= if )>(n then s
else for (m+1)nf(fms)
comp fgy=f(gy)
iter 0 f s=s
iter n f s= iter (n-1) f (fs)
zpta[]=[a]
zpt a(x:xs)= if a>x then a:(x:xs)
else a xs
What are the values of the following expressions?:
nmap even 1,2,3,4,5,6
nmap ((+)2)(nfilter even [1,2,3,4,5,6]
iter 2)4
reduce zpt []1,3,4,2,3,1
for 1013zpt[]
reduce (comp(**)(+))1[1,2,3]
Note: (**)y=x**y;,(+)y=x+y;, even )==(0
 Assume the following function definitions exist: nmap f[]=[] nmap nmap fs

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!