Data Structures & Algorithms using JavaScript Course
Data Structures & Algorithms using JavaScript
/
Advanced

Merge Sort

Definition

A Divide and Conquer algorithm that recursively divides the array into halves until they contain 1 element, then merges those sorted halves back together. Highly stable, strictly O(N log N) time, but requires O(N) space.

Explain Like I'm New

Splitting a giant messy stack of papers in half over and over until you just have single pieces of paper, then combining them back together two at a time in order.

Interactive Coding Challenges

Merge Sort Implementation

Solution Code

Loading...
Console output will appear here...