**LANGUAGE IS SCHEME*** 5. Define a Scheme function, (merge 11 12), which takes
ID: 3598178 • Letter: #
Question
**LANGUAGE IS SCHEME***
5. Define a Scheme function, (merge 11 12), which takes two lists e1 and l2 as arguments. As- suming that each of l1 and l2 are sorted lists of integers (in increasing order, say), merge must return the sorted list containing all elements of l1 and l2 To carry out the merge, observe that since l and l2 are already sorted, it is easy to find the smallest element among all those in E and (2: it is simply the smaller of the first elements of (1 and l2. Removing this smallest element from whichever of the two lists it came from, we can recurse on the resulting two lists (which are still sorted), and place this smallest element at the beginning of the result.