Speaking about sorting algorithms, one should always remember: there is more than one approach. Last time we talked about Insertion Sort and worked with one unsorted array. This time we’re going to try a different approach and more complicated pattern — Merge Sort. Our starter pack is two sorted arrays, our task is to combine them into one sorted array.

Let’s crush it!

Actually, our approach is not that different from what we did last time with Insertion Sort. Our first step is to find a minimum integer and remove it from the array but this time we’re checking two arrays instead of one.

#sorting-algorithms #algorithms #data-structures #javascript

How to deal with sorting algorithms: Merge Sort
1.25 GEEK