CPS 206 Fall 1999, Problem 5. Work alone.
Scheme Merge Sort Problem
Define and test a pure Scheme function (msort L) which returns list L, sorted in non-decreasing order, when L is a list of integers. (Pure Scheme is the subset of the Scheme language that uses no function whose name ends with "!"). Several auxiliary functions will also be needed:
This version of merge sort is one of the fastest Scheme versions of the algorithm. It avoids multiple examinations of the elements in L to do such things as counting them, to determine L's length, or to "split" L into nearly-equal pieces, by first selecting the leading half of L, and then selecting the second half of L.
After testing your program to be sure it works, submit a single file containing only the Scheme function definitions you need -- no test runs, please.