Merge Sort

Merge Sort is a very interesting algorithm that has been used in a variety of modern technology.

This article is an exercise to trying out the algorithm, it's not optimized for speed.

The fundamental idea of this algorithm is splitting the original array into a smaller part, sort them individually and merge each part back to a whole array.

Verdicts:

1. In order to fully utilize the potential of this algorithm, it's essential that the large array can be split into smaller array (equal to the number of worker processes that can sort individual array).
2. Another function can be created to merge 2 arrays into 1 sorted array. This can further be offload to multiple worker processes when merging multiple pair of arrays.
3. This algorithm is better to be implemented in a programming language that has direct access to memory to reduce the operation spent on the re-creation of an array when pop/push operation of an array.

Comments