Task 2 TopSortMerge Implementation