What is merge sort?

The input sequence of length n is divided into two subsequences of length n/2.

Merge sort is adopted for these two subsequences respectively.

Merges two sorted subsequences into a final sorted sequence.

<img src=”https://noxussj.top:3000/25/1.png”></img>

So basically it’s split, then merge, and sort as you merge

chestnuts

Merge sort is like a tournament

For example, there are A total of 8 martial artists A, B, C, D, E, F, G, H reference to participate in the tournament.

First round, pairwise, with 4 winners (Quarter Finals)

Second round, pairwise, 2 winners (Semi-final)

Third round, only two pairs left, the champion wins (final)

<img src=”https://noxussj.top:3000/25/2.png”></img>

Algorithm description

<img src=”https://noxussj.top:3000/25/3.gif”></img>

What is merge sort? Merge sort detail

additional

  • This article is published through multiple platforms of “We Media” and will not be maintained after publication. If you have any objection to the content, you can discuss it in the GitHub below
  • The ongoing maintenance / 500 + face questions before update/notes 】 https://github.com/noxussj/In…
  • [3D city modeling using three. JS (Zhuhai City)] https://3d.noxussj.top/