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,31 +0,0 @@
' Sorting algorithms/Cocktail sort with shifting bounds - VBScript
Function cocktailShakerSort(ByVal A)
beginIdx = Lbound(A)
endIdx = Ubound(A)-1
Do While beginIdx <= endIdx
newBeginIdx = endIdx
newEndIdx = beginIdx
For ii = beginIdx To endIdx
If A(ii) > A(ii+1) Then
tmp=A(ii) : A(ii)=A(ii+1) : A(ii+1)=tmp
newEndIdx = ii
End If
Next
endIdx = newEndIdx - 1
For ii = endIdx To beginIdx Step -1
If A(ii) > A(ii+1) Then
tmp=A(ii) : A(ii)=A(ii+1) : A(ii+1)=tmp
newBeginIdx = ii
End If
Next
beginIdx = newBeginIdx+1
Loop
cocktailShakerSort=A
End Function 'cocktailShakerSort
Dim B(20)
For i=Lbound(B) To Ubound(B)
B(i)=Int(Rnd()*100)
Next
Wscript.Echo Join(cocktailShakerSort(B)," ")