PROCEDURE BINSRCH(N:INTEGER;L:LL;X:INTEGER;VAR Y:INTEGER); VAR K,M,J:INTEGER; BEGIN Y:=0; K:=1; M:=N; WHILE K <= M DO BEGIN J:=(K+M) DIV 2; IF X = L[J] THEN Y:=J; IF X < L[J] THEN M:=J-1 ELSE K:=J+1 END END;