Merge Sort Visualization


Merge Sort - Sorting Algorithm Visualizer

DESCRIPTION

Merge Sort is a sorting algorithm based on the **divide and conquer** strategy, where the data structure is repeatedly divided into smaller subarrays until each subarray contains a single element.

Once divided, the algorithm merges these smaller subarrays in a sorted manner, combining them back into a single sorted array. This merging process ensures that the elements are arranged in the correct order.

This approach is known as Divide and Conquer, which is also used in other sorting algorithms, such as Quick Sort. Merge Sort guarantees a predictable **O(n log n)** time complexity, making it highly efficient for large datasets.

Merge Sort is a **stable** and **comparison-based** sorting algorithm that is particularly useful for sorting linked lists and external sorting operations where data cannot fit into memory.

The algorithm works by recursively **splitting** the array into two halves, sorting each half separately, and then **merging** them back together in a sorted order.

COMPLEXITY

Average Complexity O(n × log n)
Best Case O(n × log n)
Worst Case O(n × log n)
Space Complexity O(n)
Quick Sort Visualization

MERGE SORT IMPLEMENTATION

                    
                
Merge Sort Visualization