Question: Standard ML, tail recursion and equivalence. (a) Write a pure function rev that takes a list as a parameter (list of any type) and returns

Standard ML, tail recursion and equivalence.

Standard ML, tail recursion and equivalence. (a) Write a pure function rev

(a) Write a pure function rev that takes a list as a parameter (list of any type) and returns a list with the same elements but in reverse order. Example: rev [1,2,3] returns [3,2,1) its parameter and return type should be polymorphic it should be tail recursive assume that is not tail recursive (i.e. do not use @), but :: is tail recursive (a) Write a pure function rev that takes a list as a parameter (list of any type) and returns a list with the same elements but in reverse order. Example: rev [1,2,3] returns [3,2,1) its parameter and return type should be polymorphic it should be tail recursive assume that is not tail recursive (i.e. do not use @), but :: is tail recursive

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!