Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,29 @@
|
|||
sub InsertionSort (matriz())
|
||||
for i = 1 to arraysize(matriz(),1)
|
||||
valor = matriz(i)
|
||||
j = i - 1
|
||||
while (j >= 0) and (valor < matriz(j))
|
||||
matriz(j + 1) = matriz(j)
|
||||
j = j - 1
|
||||
wend
|
||||
matriz(j + 1) = valor
|
||||
next i
|
||||
end sub
|
||||
|
||||
//--------------------------
|
||||
dim array(10)
|
||||
print "Antes de ordenar:"
|
||||
for i = 1 to 10
|
||||
array(i) = int(ran(32768))
|
||||
print array(i), " ";
|
||||
next i
|
||||
print
|
||||
print "\nDespues de ordenar:"
|
||||
|
||||
InsertionSort(array())
|
||||
|
||||
for i = 1 to 10
|
||||
print array(i), " ";
|
||||
next i
|
||||
print
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue