Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,26 @@
fn cocktailSort arr =
(
local swapped = true
while swapped do
(
swapped = false
for i in 1 to (arr.count-1) do
(
if arr[i] > arr[i+1] then
(
swap arr[i] arr[i+1]
swapped = true
)
)
if not swapped then exit
for i in (arr.count-1) to 1 by -1 do
(
if arr[i] > arr[i+1] then
(
swap arr[i] arr[i+1]
swapped = true
)
)
)
return arr
)