Question: How to correct error?

Question:How to correct error?

SYY 5 Maple

Bubble := proc (X::list)

local n, i, j, t;

n := nops(X);

if n = 0 then ERROR("empty list") end if;

for i to n-1 do

   for j to n-i do

      if X[j+1] < X[j] then

          t := X[j];

          X[j] := X[j+1];

          X[j+1] := t;

      end if;

   end do;

end do;

print(X);

end proc

 

I make bubble sort algorithm. but i can't find 'illegal use of a formal parameter'.

Please Wait...