Question: Each exercise below requires you to implement a single function using the OCaml programming language. Unless explicitly mentioned, you should not use any built-in functions

Each exercise below requires you to implement a single function using the OCaml programming language. Unless explicitly mentioned, you should not use any built-in functions or special forms. If you wish, however, you may implement additional helper functions on top of the required ones.

Note that some exercises specify whether your solution should be tail-recursive (or not). If unspecified, you may do either.

Each exercise below requires you to implement a single function using the

4. merge : Takes two argument lists, both of which contain only integers and are in ascending order. Returns a single list containing all the integers, sorted in ascending order. E.g.r #merge[1;4;8;10][2;3;7;13];;-:intlist=[1;2;3;4;7;8;10;13] Your implementation should not be tail-recursive (we'll do that next). 5. merge_tail : re-implement the previous function, but this time your implementation should be tail-recursive. As with your implementation of concatenate, you may only use the : : constructor to build your result list, and it should have linear runtime w.r.t. the total number of integers

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!