Difference between revisions 8124235 and 8419559 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) // eg, h = 8, hh = 13 h = hh - h; // h = 13 - 8 = 5 hh = hh - h; // hh = 13 - 5 = 8 } }</pre> === Using a list of shell sizes in C Edit By Z80user === table[] is table to sort table_size is ... <pre> int table[]= {10,9,8,7,6,5,4,3,2,1}; int cols[]= {1391376,463792,198768,86961,33936,13776,4592,1968,861,336,112,48,21,7,3,1}; int table_size=10; // change it int n,m,h,j,v; for (n=0;n<16;n++) { h=cols[n]; for (m=0;m<table_size;m++) { v=tabla[m]; j=m; while (j>=h && tabla[t][j-h]>v) { tabla[j]^=tabla[j-h]; // Swap data tabla[j-h]^=tabla[j]; // I Think java also need this change tabla[j]^=tabla[j-h]; // but i don`t hace compiler of java j=j-h; } } tabla[j]=v; } </pre>⏎ ⏎ ==References== [Se] R. Sedgewick: Algorithms. Addison-Wesley (1988)<br> [Sh] D.L. Shell: A high-speed sorting procedure. Communications of the ACM 2 (7), 30-32 (1959) == External links == *[http://www.iti.fh-flensburg.de/lang/algorithmen/sortieren/shell/shellen.htm Detailed analysis of Shell sort] * [http://www.nist.gov/dads/HTML/shellsort.html Dictionary of Algorithms and Data Structures: Shellsort] [[de:Shellsort]] [[es:Ordenación Shell]] [[nl:Shellsort]] [[ja:シェルソート]] [[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=8419559.
![]() ![]() 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.
|