developer-student-club-thapar / algo-book

The algo book that contains various algorithms in 4 different languages
https://algo-book.dsctiet.tech
GNU General Public License v3.0
16 stars 44 forks source link

Implemented a new algorithm(Shell Sort) with Documentation. #118

Closed nishamehra closed 3 years ago

nishamehra commented 3 years ago

Shell sort is often termed as an improvement over insertion sort. In insertion sort, we take increments by 1 to compare elements and put them in their proper position.

In shell sort, the list is sorted by breaking it down into a number of smaller sublists. It’s not necessary that the lists need to be with contiguous elements. Instead, shell sort technique uses increment i, which is also called “gap” and uses it to create a list of elements that are “i” elements apart.