Question: Help with cocktail sort please

Below is my attempt at a cocktail sort, there are two lines of code missing as i am unsure as what to put there. I think the rest is correct.

Please check and see if you can spot what i need to include.

restart:
cocktailsort:=proc(C)
local n,o,r,k,i:
n:=rtable_dims(C):
o:=rhs(n):
r:=lhs(n):
############# I dont know what to put in the next two lines, it has to be for something ########
if C[i] > C[i+1] then
(C[i], C[i+1] ) := (C[i+1], C[i]);
else
(C[i], C[i+1] ) := (C[i], C[i+1] );
fi:
if C[k] < C[k-1] then
(C[k-1],C[k]) := (C[k],C[k-1]);
else
(C[k-1],C[k]) := (C[k-1], C[k]);
fi:
od:
od:
print(C);
end proc:

Please could someone help me.....

 

 

Please Wait...