Question: 1. Implement the Merge Sort algorithm as a Haskell function. The function should take a list of values in the Haskell class Ord and return

1. Implement the Merge Sort algorithm as a Haskell function. The function should take a list of values in the Haskell class Ord and return a sorted list. The type signature will be mergeSort:: (Ord a) la] -> [a] Recall that merge sort works as follows: a. Split the list into two approximately equal sublists b. Sort each sublist using merge sort C. Merge the two sorted sublists I am providing some Java code for this algorithm. Your task is to convert this code into Haskell Note that I made merge a private method, since it is only used in mergeSort. For the same reason, you should implement merge in Haskell using either the where or the let construct. Of course, your implementation will be recursive instead of iterative. As a hint, you will need three base cases: merging two empty lists, merging an empty list with a non-empty list, and merging a non-empty list with an empty list.)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
