41. implement Merge Sort

JavaScriptAlgorithm
Is this helpful ?

medium  - accepted / - tried

Even for Front-End Engineer, it is a must to understand how basic sorting algorithms work.

Now you are asked to implement Merge Sort, which sorts an integer array in ascending order.

Do it in-place, no need to return anything.

Follow-up

What is time cost for average / worst case ? Is it stable?

Let's try to solve this problem within 10 mintues.

Discuss(11)