home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of Shareware - Software Farm 2
/
wosw_2.zip
/
wosw_2
/
PASCAL
/
NRPAS13.ZIP
/
PIKSRT.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1991-04-29
|
466b
|
21 lines
PROCEDURE piksrt(n: integer; VAR arr: glsarray);
(* Programs using routine PIKSRT must define the type
TYPE
glsarray = ARRAY [1..np] OF real;
in the main routine, with np >= n. *)
LABEL 10;
VAR
j,i: integer;
a: real;
BEGIN
FOR j := 2 TO n DO BEGIN
a := arr[j];
FOR i := j-1 DOWNTO 1 DO BEGIN
IF (arr[i] <= a) THEN GOTO 10;
arr[i+1] := arr[i]
END;
i := 0;
10: arr[i+1] := a
END
END;