Sorting algorithms/Insertion sort: Difference between revisions
Content added Content deleted
m (moved Insertion sort to Sorting algorithms/Insertion sort) |
|||
Line 453:
<lang pli>INSSORT: PROCEDURE (A,N);
DCL (A(*)) FIXED BIN(31),
N FIXED BIN(31)
DCL (I,J,V) FIXED BIN(31);
DO I=2 TO N;
V=A(I);
J=I-1;
DO WHILE (J > 0
if A(J
A(J+1)=A(J); J=J-1;
END;
A(J+1)=V;
|