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,18 @@
%Required inputs:
%i = 1
%j = length(list)
%
function list = stoogeSort(list,i,j)
if list(j) < list(i)
list([i j]) = list([j i]);
end
if (j - i) > 1
t = round((j-i+1)/3);
list = stoogeSort(list,i,j-t);
list = stoogeSort(list,i+t,j);
list = stoogeSort(list,i,j-t);
end
end

View file

@ -0,0 +1,5 @@
>> stoogeSort([1 -6 4 -9],1,4)
ans =
-9 -6 1 4