{проверка на равенство деревьев}
function equal(p1, p2 : Ttree) : boolean;
begin
if (p1=nil) and (p2=nil) then equal := true
else
if (p1<>nil) and (p2<>nil)
then equal := (p1^.info= p2^.info) and equal(p1^.llink, p2^.llink)
and equal(p1^.rlink, p2^.rlink)
else equal := false
end;