Question: Write purely functional Scheme functions to (a) Return all rotations of a given list. For example, (rotate (a b c d e)) should return ((a
Write purely functional Scheme functions to
(a) 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).
(b) Return a list containing all elements of a given list that satisfy a given predicate. For example, (filter (lambda (x) (< x 5)) ‚(3 9 5 8 2 4 7)) should return (3 2 4).
Step by Step Solution
3.44 Rating (170 Votes )
There are 3 Steps involved in it
a b define rotations lambda ... View full answer
Get step-by-step solutions from verified subject matter experts
