merge_sort and multi_merge algorithm