Question: Consider function consR which creates a new list with its arguments by places an element to the right of a list, just as function cons

Consider function consR which creates a new list with its arguments by places an element to the right of a list, just as function cons creates a new list by placing an element on the left of a list. For example, consR((a, b, c), d) = (a, b, c, d) .

(a) Provide a recursive computable function definition for consR(L, e) (in mathematical notation).

(b) Translate the above definition into function consr(lst elt). Do not use append or list.

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 Programming Questions!