Merge Sort is a popular sorting algorithm known for its efficiency and stablility. It follows the divide-and-conquer approach to sort a given array of elements.
let's sort the array or list [38, 27, 43, 10] using Merge Sort.
Divide the array into 2 equal parts
Divide the subArrays into 2 parts
Combine individual items into a sorted group
Put together the sorted groups into one sorted list
Divide:
Conquer:
Merge:
Therefore, the sorted list is [10, 27, 38, 43].