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
Get step-by-step solutions from verified subject matter experts
