Question: 2. Define the following functions: a. (pad x ) returns the list x in which each zero element is replaced by the previous non-zero element

2. Define the following functions: a. (pad x ) returns the list x in which each zero element is replaced by the previous non-zero element in the list. Any leading zeros will remain unchanged. b. (aprog x ) returns True if list x is an arithmetic progression and False olherwise first) can be Recall that an arithmetic progression is a sequence in which each element (except the firs obtained from the previous one by adding a fixed value called the common difference difference here is 3 ). (6 marks) Answer: ( debine (pad x ) (cond (mull? x ) (lecx) (lat(cosx)0) (log(cosx)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
