@zealousgod The shell sort is similar to an insertion sort. The key difference is that you do multiple passes of insertion sorts, but in the earlier passes you skip over elements (in this case we skip every second element in the first pass). The gap you skip over decreases in each pass until you're just doing a plain insertion sort over an array that should be almost sorted by now.
Wow...way to waste 1:17 of my life!
dgriderjw 1 year ago
@dgriderjw Dont blame him, pussy.
Vorbis5 1 year ago
@Vorbis5 Ok, I'll blame you asshole...
dgriderjw 1 year ago
@dgriderjw lol, ok
Vorbis5 1 year ago
This is insertion sort
zealousgod 1 year ago
@zealousgod The shell sort is similar to an insertion sort. The key difference is that you do multiple passes of insertion sorts, but in the earlier passes you skip over elements (in this case we skip every second element in the first pass). The gap you skip over decreases in each pass until you're just doing a plain insertion sort over an array that should be almost sorted by now.
Sakanakao 1 year ago 4