Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,38 @@
|
|||
#define MAXNUM 100
|
||||
|
||||
Sub beadSort(bs() As Long)
|
||||
Dim As Long i, j = 1, lb = Lbound(bs), ub = Ubound(bs)
|
||||
Dim As Long poles(MAXNUM)
|
||||
|
||||
For i = 1 To ub
|
||||
For j = 1 To bs(i)
|
||||
poles(j) += 1
|
||||
Next j
|
||||
Next i
|
||||
For j = 1 To ub
|
||||
bs(j) = 0
|
||||
Next j
|
||||
For i = 1 To Ubound(poles)
|
||||
For j = 1 To poles(i)
|
||||
bs(j) += 1
|
||||
Next j
|
||||
Next i
|
||||
End Sub
|
||||
|
||||
'--- Programa Principal ---
|
||||
Dim As Long i
|
||||
Dim As Ulong array(1 To 8) => {5, 3, 1, 7, 4, 1, 1, 20}
|
||||
Dim As Long a = Lbound(array), b = Ubound(array)
|
||||
|
||||
Randomize Timer
|
||||
|
||||
Print "unsort ";
|
||||
For i = a To b : Print Using "####"; array(i); : Next i
|
||||
|
||||
beadSort(array())
|
||||
|
||||
Print !"\n sort ";
|
||||
For i = a To b : Print Using "####"; array(i); : Next i
|
||||
|
||||
Print !"\n--- terminado, pulsa RETURN---"
|
||||
Sleep
|
||||
Loading…
Add table
Add a link
Reference in a new issue