PROCEDURE BREADTH(VAR N:INTEGER); VAR I,J:INTEGER; BEGIN K:=1; Q[ 1 ]:=1; WH:=2; FOR I:=1 TO N DO WRITE(P[I,Q[1]]=0); WHILE Q[ 1 ]<>0 DO BEGIN FOR I:=1 TO N DO SEARCH [ I,K ] := ALPHA [ Q[I] ]; K:=K+1; RH:=Q[ 1 ]; FOR I:=1 TO N DO IF P[ RH,I ]=1 THEN BEGIN Q[WH]:=I; WH:=WH+1; FOR J:=1 TO N DO P[J,I]:=0 END; FOR I:=1 TO N DO Q[I]:=Q[ I+1 ]; WH:=WH-1 END; END;