Answered step by step
Verified Expert Solution
Question
00
1 Approved Answer
Using Scheme: Write a function absDiff that calculates the absolute difference of the corresponding elements of two lists. The function also evaluates to a list.
Using Scheme:
Write a function absDiff that calculates the absolute difference of the corresponding elements of two lists. The function also evaluates to a list. (absDiff'(1 3 5 6) (3 5 2 1)). - (2 2 3 5). The function must also work if the two input lists are not the same length. We ask you to create two versions of this function: Assume that the missing elements in the shorter list have the value of 0. The result will be of length equal to the longer list. (3 5 2 1)). (absDiffA (1 3 5 6 2 5) > (2 2 3 5 2 5) (3 5 2 1 2 5)) (absDiffA '(1 3 5 6) > (2 2 3 5 2 5) b) Ignore the extra values of the longer list. The result will be of length equal to the shorter list. (3 5 2 1) ). (absDiffB (1 3 5 6 2 5) > (2 2 3 5). (absDiffB '(1 3 5 6) > (2 2 3 5) (3 5 2 1 2 5))Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started