Merge sort is widely used in various applications, including sorting large databases, numerical analysis, and parallel computing. This is an implementation of merge sort in ocaml that takes a user specified ordering function compare and a list as arguments, and returns a copy of the list, sorted according to the ordering function. I created a function (mergesort) in ocaml but when i use it, the list is inverted In addition, i want to calculate the time the system takes to do the calculation, how can i do it Defining a custom compare function (here a case insensitive string comparison) and using it to sort an array I have a homework prompt that reads
Merge xs ys takes two integer lists, each sorted in increasing order, and returns a single merged list in sorted order. In the last few days, whenever i could, i was working on writing merge sort in ocaml Merge two lists according to the given predicate Assuming the two argument lists are sorted according to the predicate, merge returns a sorted list containing the elements from the two lists The behavior is undefined if the two argument lists were not sorted.
OPEN