Question: Write purely functional Scheme functions to: 1) return all rotations of a given list. For example, (rotate '(a b c d e)) should return ((a

Write purely functional Scheme functions to:

1) return all rotations of a given list. For example, (rotate '(a b c d e)) should return ((a b c d e) (b c d e a) (c d e a b) (d e a b c) (e a b c d)) in some order - not necessarily in the one given in the example.

2) return a list of all elements of a given list that satisfy a given boolean function. For example (filter (lambda (X) ( < X 5)) '(3 9 5 8 2 4 7)) should return (3 2 4). Comment you code - in Scheme a comment is anything that follows the ";" (semicolon) character on a line.

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!