Another update from ingydotnet^djgoku
This commit is contained in:
parent
91df62d461
commit
948b86eafa
7604 changed files with 108452 additions and 22726 deletions
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue