Question: Using merge, define a function msort : : Ord a = > [ a ] [ a ] that implements merge sort, in which the
Using merge, define a function msort : : Ord that implements merge sort, in which the empty list and singleton lists are already sorted, and any other list is sorted by merging together the two lists that result from sorting the two halves,of the list separately.
Hint: first define a function halve : : that splits a list into two halves whose lengths differ by at most one.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
