Question: Kindly solve it in SML programming language. 1. Write a recursive ML function using pattern matching with name/type fill:intintintintlist that inputs an integer x, an

Kindly solve it in SML programming language.

Kindly solve it in SML programming language. 1. Write a recursive ML

1. Write a recursive ML function using pattern matching with name/type fill:intintintintlist that inputs an integer x, an integer s, and a non-negative integer n. It will return the list [x,x+s, x+2s,x+3s,,x+(n1)s] where the list starts with the value x and then each successive value adds s to the previous value until there are n values in the list. (You may assume valid inputs.) For example, - fill (1,3,7); val it =[1,4,7,10,13,16,19] : int list - fill (0,10,5); val it =[0,10,20,30,40] : int list 2. Write an ML accumulation function with name and type h:intintint that will be used with one of the reduce functions so that it will return the largest integer in a list of positive integers. For example: -foldlh?[2,8,5,1,7,6];valit=8:int In addition to submitting the code for h, submit the test case above with an appropriate initial value to demonstrate that your accumulation function produces the correct

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!