Algorithms: Merge sort implementation