Question: Please answer the question in the Scheme programming language. The function can be recursive or tail recursive. Both ways are appreciated. Please do not answer
Please answer the question in the Scheme programming language. The function can be recursive or tail recursive. Both ways are appreciated. Please do not answer the question in any other programming language.
Write a function called replaceallwith* that takes an atom, a list that may contain sublists, and a replacement list of atoms. If the atom is occurred in the list, then replace the atom with the first atom of the replacement list. Similarly, the second occurrence of the atom in the list is replaced with the second atom in the replacement list, and so on.
Sample test run:

>(replaceallwithx(abx((cd((x)efx)g(xixxj))))(1234456789)) '(a b 1((c d ((2) e f3) g (4 i 56 j ))))
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
