Shell Sort

Table of Contents

Shell Sort

This is basically insertion sort with different gap values. For insertion sort, the gap value is always 1.

There will be several iterations using larger gap values but the last iteration will always be using a gap value = 1. At that point, it is basically the same as insertion sort.

The same logic can be applied to bubble sort as well.

We start with gap value = size / 2 and decrementing it by 2 each time.

https://github.com/explorer436/programming-playground/blob/main/java-playground/my-java-solutions/src/main/java/com/my/company/sorting/algorithms/ShellSort.java


Links to this note