Another update from ingydotnet^djgoku

This commit is contained in:
Ingy döt Net 2015-11-18 06:14:39 +00:00
parent 91df62d461
commit 948b86eafa
7604 changed files with 108452 additions and 22726 deletions

View file

@ -0,0 +1,30 @@
siz = 100
dim a(siz)
for i = 1 to siz
a(i) = int(rnd(1) * 1000)
next
' -------------------------------
' Shell Sort
' -------------------------------
incr = int(siz / 2)
WHILE incr > 0
for i = 1 to siz
j = i
temp = a(i)
WHILE (j >= incr+1 and a(abs(j-incr)) > temp)
a(j) = a(j-incr)
j = j - incr
wend
a(j) = temp
next
IF incr = 2 THEN
incr = 1
ELSE
incr = int(incr * (5 / 11))
end if
WEND
for i = 1 to siz
print a(i)
next