When I first started watching this, I was stunned. After reading a few more articles of others, I understood

Before WE get into this Hill sort, I want to play a little game that you’ve probably played. Hill sort is similar to this little game

Xiao Ming (player), Angela (question maker)

Angela: Please guess a number between 0 and 100. The fewer guesses you make, the higher the score

A normal player would start at zero and guess one by one, 0, 1, 2, 3… And if you keep doing that, if you’re unlucky you might have to make 99 guesses to get it right.

Hill sort is an updated version of insert sort, with the main purpose of reducing the number of guesses

Ming finally uses the /2 method to make guesses (this is hill sort).

---------------------------------------------------

The answer to

Xiaoming: Guess the number is 50

Angela: The numbers are too small

Xiaoming: So the range must be between 50 and 100. This time I guess 75

Angela: The numbers are too small

Xiaoming: So the range must be between 75 and 100. I guess 87 this time

Angela: The numbers are too small

Xiaoming: So the range must be between 87 and 100. I guess 93 this time

Angela: The numbers are too big

Xiaoming: So the range must be between 87 and 93. Guess 90 this time

Angela: The numbers are too big

Xiaoming: So the range must be between 87 and 90. I guess 89 this time

Angela: The numbers are too big

Xiaoming: Then the range must be between (87~89), there are 3 numbers left, then we can guess one by one (insertion sort) 87, 88, 89

Angela: The answer is 88

---------------------------------------------------

Now let’s get down to business

What is Hill sort?

Hill sort is grouping in a sequence (delta for short) and then inserting into each of the groups separately. As the increments decrease, each group contains more and more keywords. When the increments decrease to 1, the whole sequence is exactly divided into a group and the algorithm terminates

Algorithm description

The hill sort algorithm is worth collecting ten classical sorting algorithms

The content/inspiration of the article is taken from below

  • Continuous maintenance/update 500+ front end questions/notes github.com/noxussj/Int…

  • [Big data visualization chart plug-in] www.npmjs.com/package/ns-…

  • [3D city modeling using three.js (Zhuhai)] 3D.noxussJ.top /