Question: Write a recursive Scheme function with two parameters, an atom and a list, that returns the list with all occurrences, no matter how deep, of
Write a recursive Scheme function with two parameters, an atom and a list, that returns the list with all occurrences, no matter how deep, of the given atom deleted. The returned list cannot contain anything in place of the deleted atoms.
An atom is anything thats not a list, e.g., numbers or symbols. For comparing atoms for equality use eqv?. The pointer equality test eq? is not guaranteed to work for numbers, = only works for numbers. A precise description of these functions can be found in the section Equivalence predicates in the Revised(5) Report on the Algorithmic Language Scheme, which is available off the course web page.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
