Question: Complete this function in Ocaml (* Sort list l via mergesort cmp is a function that compares two elements of list l. When cmp returns
Complete this function in Ocaml
(* Sort list l via mergesort
cmp is a function that compares two elements of list l. When cmp
returns true, its first argument comes first in the sorted lest.
When cmp returns false, its second argument comes first in the
sorted list. *)
let rec mergesort (cmp : 'a->'a->bool) (l:'a list) : 'a list =
(* TODO, replace [] *)
[]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
