Question: Write Scheme functions with the following description: Usage: (powerlist x) Before: x is a finite list, x=(x1 x2 ... x N) After: The list (y1

 Write Scheme functions with the following description: Usage: (powerlist x) Before:

Write Scheme functions with the following description: Usage: (powerlist x) Before: x is a finite list, x=(x1 x2 ... x N) After: The list (y1 y2 y3...) For example: (powerless '()) should give (()) (powerlist '(1)) could give (() (1)) or the list ((1) ()). (powerlist '(12)) could give (() (1) (2) (1 2)) Usage: (cross a b) Before: a and b are finite lists, a=(a1, a2, ... aN) x = (b1, b2, ..., bM) After: List, ((a1 b1) (a1 b2 ... (a1 bM).. For example (Cross '() (1 2 3)) should give () (Cross '(1) '(4)) should give ((1 1)) (Cross '(1 2) '(3 4)) should give ((1 3) (1 4) (2 3) (2 4)) // map and append can be used

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!