Shuffle Modes: 1 - Random Shuffle 2 - Backwards Sorted. 3 - Almost Sorted. 4 - Already Sorted. Gap Sequences: 1 - Shellsort's Original Gap sequence(2^k) 2 - 3-Smooth Numbers Gap sequence.(factorised to the form 2^p * 3^q, where the primes in its factors are less than or equal to 3. Least expensive in terms of array writes.)(https://oeis.org/A003586) 3 - Power of Three Gap sequence(https://oeis.org/A003462) 4 - Sedgewick's Gap sequence(https://oeis.org/A036562) 5 - Sedgewick-Incerpi's Gap sequence(https://oeis.org/A036569) 6 - Tokuda's Gap sequence(https://oeis.org/A108870) 7 - Ciura's Gap sequence(empirically found values, can be extended with 2.25^k-1. Fastest gap sequence. Extended from 1750 with ratio ~2.352, based on logarithmic regression.)(https://oeis.org/A102549) 8 - My own gap sequence. (2.4^k-1, with some manual alterations. Faster than most gap sequences.)
Shell Sort is Insertion Sort with gaps in between elements. It is an iterative, in-place, comparative sorting algorithm. Worst Case time complexity is O(n^2), Average Case time complexity is O(n log n) and Best Case time complexity is O(n). Sorting time depends heavily on gap sequence. Shell Sort is adaptive(because it has its roots on Insertion Sort which is also adaptive). For gapSize = 1, Shell Sort becomes Insertion Sort with Linear Search. UPDATES -------------- Latest Release(14-05-2023): Updated my own gap sequence with empirically found values. 0.32% slower than Ciura's gap sequence on sorting 8000 elements. Latest Release(09-08-2020): Added option to control speed. Enter as a non-zero positive number. It will become the speed factor of the visualization(for example entering 2 in Speed will make the visualization run 2 times faster and entering 0.5 will make it run 2 times slower). 18-01-2021: 10 views!