Question: Using Standard ML functional programming: (a) Write a polymorphic function that takes a list as a parameter and splits it into two lists and returns
Using Standard ML functional programming:

(a) Write a polymorphic function that takes a list as a parameter and splits it into two lists and returns them as a tuple. Elements in odd positions are returned in the first list. Elements in even positions are returned in the second list. Example: split [3,9,10,2,5] returns ([3,10,5], [9,2]). Hint: use induction to find a solu- tion to the problem, then code it. (a) Write a polymorphic function that takes a list as a parameter and splits it into two lists and returns them as a tuple. Elements in odd positions are returned in the first list. Elements in even positions are returned in the second list. Example: split [3,9,10,2,5] returns ([3,10,5], [9,2]). Hint: use induction to find a solu- tion to the problem, then code it
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
