Add merge sort algorithm implementation.