Question: I am trying to implement a merge sort in SML language. I can't figure how to write this frunction. Everything I try gives an error.

I am trying to implement a merge sort in SML language. I can't figure how to write this frunction. Everything I try gives an error. I need a recursive function that will take a list of lists and merge pairs of lists. The number of sublists may not necessarily be even. For example:

mergePass([[24],[39],[50],[28],[50],[1],[15],[1],[35],[40],[9],[8],[25],[1],[2]]) returns [[24,39],[28,50],[1,50],[1,15],[35,40],[8,9],[1,25],[2]] mergePass([[24,39],[28,50],[1,50],[1,15],[35,40],[8,9],[1,25],[2]]) returns [[24,28,39,50],[1,1,15,50],[8,9,35,40],[1,2,25]]

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!