Merge sort is an O(n log n) sorting algorithm that uses a divide and conquer approach. It divides the list into halves, recursively sorts each half through merge sorting, and then merges the sorted halves back together into a single sorted list.
2. MERGE SORT
is an O (n log n) comparison-based sorting
algorithm
Divide and conquer method
It takes the list to be sorted and divide it in half to
create two unsorted lists. The two unsorted lists are
then sorted and merged to get a sorted list. The
two unsorted lists are sorted by continually calling
the merge-sort algorithm.
3. CONCEPT:
1. Divide the list in half
2. Merge sort the first half
3. Merge sort the second half
4. Merge both halves back together