Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,35 @@
global array
dim array(15)
a = array[?,]
b = array[?]
for i = a to b-1
array[i] = int(rand * 100)
next i
print "unsort ";
for i = a to b-1
print rjust(array[i], 4);
next i
call insertionSort(array) # ordenar el array
print chr(10); " sort ";
for i = a to b-1
print rjust(array[i], 4);
next i
end
subroutine insertionSort(array)
lb = array[?,]
for i = lb + 1 to array[?]-1
valor = array[i]
j = i - 1
while j >= lb and array[j] > valor
array[j +1] = array[j]
j -= 1
end while
array[j+1] = valor
next i
end subroutine