Question: SCHEME Programming Language Question! I need to construct this function in SCHEME. Please do not give me an answer in another language. reverselists takes a

SCHEME Programming Language Question!

I need to construct this function in SCHEME. Please do not give me an answer in another language.

reverselists takes a list, possibly containing sublists. The outerlist is not reversed, but each sublist is reversed. Any sublists inside those lists should stay in the original order, but sublists of the sublists should be reversed. This pattern should repeat for as many layers of sublists are in the list.

> (reverselists '(a b c d)) (a b c d) > (reverselists '(a b (c d e f) g h (i j k l))) (a b (f e d c) g h (l k j i)) > (reverselists '(a b (c (d e) f) g h ((i (j k)) l))) (a b (f (d e) c) g h (l (i (k j))))

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!