Merge Sort is more advanced, divide-and-conquer algorithm that recursively splits an unsorted list into smaller sublists until each contains a single element. These sublists are then merged back together in a sorted manner. With a time complexity of O(n log n), Merge Sort is efficient and stable, making it suitable for handling large datasets.
function mergeSort(start, end):
if start < end:
mid = length(arr) / 2
mergeSort(start, mid)
mergeSort(mid + 1, end)
merge(start, mid, end)