Difference between revisions 11761535 and 12178917 on enwiki'''Shell sort''' (or '''Shellsort''') is one of the oldest [[sorting algorithm|sorting algorithms]]. It was invented in 1959 by [[D. L. Shell|Donald L. Shell]] <nowiki>[</nowiki>[[#References|Sh]]<nowiki>]</nowiki>. It is fast, easy to understand and easy to implement. However, its complexity analysis is a little more sophisticated. (contracted; show full) == Implementations == === Using a list of shell sizes === The following [[Java_programming_language|Java]] program sorts an array ''a'' from index position 0 through ''n''-1. The number of columns used for arranging data in each step is in array ''cols''. Thus, data are arranged in 1,391,3764,356,424 columns in the first step and in one column in the last step. Note that essentially nothing is done if the number of columns ''h'' is larger than the number of data elements ''n''. Each column is sorted by insertion sort. First, data of the second row, beginning at ''i'' = ''h'', are sorted to the correct position in their column, then data of the third row (when ''i'' reaches value 2''h''(contracted; show full) [[de:Shellsort]] [[es:Ordenación Shell]] [[lt:Kevalo rūšiavimo algoritmas]] [[nl:Shellsort]] [[ja:シェルソート]] [[zh:希尔排序]] [[Category:Sort algorithms]] All content in the above text box is licensed under the Creative Commons Attribution-ShareAlike license Version 4 and was originally sourced from https://en.wikipedia.org/w/index.php?diff=prev&oldid=12178917.
![]() ![]() This site is not affiliated with or endorsed in any way by the Wikimedia Foundation or any of its affiliates. In fact, we fucking despise them.
|