Implementation of Merge sort
Implementation Introduction The sorting method that you currently use is inefficient when it comes to dealing with a large amount of data. So I recommend that you replace your current sorting method with merge sort to address the issue. Merge sort uses the divide-and-conquer technique and recursion to improve the runtime tremendously. ... The basic idea of divide-and-conquer sorting is to divide a large data set into several small sets, to sort each portion of the small data sets recursively, and to combine the results of each small portion into a solution for the original data sets. ... Merge sort uses the divide-and-conquer approach. ... Merge-Sort (A, p, r) 1 if p < r 2 then q ¡û lower bound of ((p+r)/2) 3 Merge-Sort(A, p, q) 4 Merge-Sort(A, q+1, r) 5 Merge(A, p, q, r) Figure 2.