Data update

This commit is contained in:
Ingy döt Net 2026-02-01 16:33:20 -08:00
parent 5150844a7d
commit 4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions

View file

@ -1,42 +0,0 @@
function findMax( a )
dim num
dim max
max = 0
for each num in a
if num > max then max = num
next
findMax = max
end function
function findMin( a )
dim num
dim min
min = 0
for each num in a
if num < min then min = num
next
findMin = min
end function
'the function returns the sorted array, but the fact is that VBScript passes the array by reference anyway
function countingSort( a )
dim count()
dim min, max
min = findMin(a)
max = findMax(a)
redim count( max - min + 1 )
dim i
dim z
for i = 0 to ubound( a )
count( a(i) - min ) = count( a( i ) - min ) + 1
next
z = 0
for i = min to max
while count( i - min) > 0
a(z) = i
z = z + 1
count( i - min ) = count( i - min ) - 1
wend
next
countingSort = a
end function

View file

@ -1,5 +0,0 @@
dim a
a = array(300, 1, -2, 3, -4, 5, -6, 7, -8, 100, 11 )
wscript.echo join( a, ", " )
countingSort a
wscript.echo join( a, ", " )