递归算法:
procedure Move(No: Integer;
from, to: Integer);
begin
wirteln('Move ', No, ' From ', from, ' To ', to)
end;
procedure Haino(n: Integer;
from, to, mid: Integer)
begin
if n=0 then
exit
else
begin
haino(n-1, from, mid, to);
move(n, from, to);
haino(n-1, mid, to, from)
end
end;
还有非递归算法