Created
June 9, 2009 09:06
-
-
Save DasLampe/126372 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
h := 1; // Shell-Sort | |
repeat | |
h := 3 * h + 1; | |
until h > LBoxDemo.Items.Count - 1; | |
repeat | |
h := h div 3; | |
for i := h to (LBoxDemo.Items.Count - 1) do | |
begin | |
str := LBoxDemo.Items[i]; | |
j := i; | |
while ((j >= h) and (LBoxDemo.Items[j-h] > str)) do | |
begin | |
LBoxDemo.Items[j] := LBoxDemo.Items[j-h]; | |
j := j - h; | |
end; | |
LBoxDemo.Items[j] := str; | |
end; | |
until h <= 1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment