Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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.
(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 recursiveStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started