Question: Using Standard ML language to solve the problem using RECURSIVE definitions . . Write a function get_nth that takes an int list (xs: int list)

Using Standard ML language to solve the problem using RECURSIVE definitions.

Using Standard ML language to solve the problem using RECURSIVE definitions. .

. Write a function get_nth that takes an int list (xs: int list) and an int (n : int) and returns the nth element of xs. Take into account the case where xs may have too few elements; your function may return NONE for such lists and return SOME x for lists having enough elements, where x is the nth element of xs. For example, get_nth (1355, 2017, 55, 10],3) ->SOME 55 get nth (1355, 2017, 55, 10], 6 ->NONE

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!