Question: 4. (14 pts) Write a recursive Scheme function (flatten L), which takes as arguments a list L (possibly containing sublists), and returns a list containing

 4. (14 pts) Write a recursive Scheme function (flatten L), which

4. (14 pts) Write a recursive Scheme function (flatten L), which takes as arguments a list L (possibly containing sublists), and returns a list containing al elements in L and its sublists, but all at the same level. The following example illustrates the use of this function: (flatten' (1 (2 (3 4)) 5)) (1 2 3 4 5)

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!