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,71 @@
x : 23 : 15 : 99 : 146 : 3 : 66 : 71 : 5 : 23 : 73 : 19
quicksort param l r
l i
r j
((l+r) shr 1) k
x.k pivot
repeat
if pivot > x.i
+ cmp
+ i
goif
endif
if pivot < x.j
+ cmp
- j
goif
endif
if i <= j
swap x.i x.j
- j
+ i
endif
if i <= j
go repeat
endif
if l < j
save l r i j
call quicksort l j
restore l r i j
endif
if i < r
save l r i j
call quicksort i r
restore l r i j
endif
return
start
' original values : ' $r
call showvalues
call quicksort 0 10
' sorted values : ' $r
call showvalues
stop
showvalues
$s
i
if i <= 10
"$s ' ' x.i ' '" $s
+ i
goif
endif
" $r $s " []
return