procedure f(var A : array of integer; L, R: Integer); var I, J: Integer; P, T: Integer; begin repeat I := L; J := R; P := A[(L + R) shr 1]; repeat while A[I] < P do Inc(I); while A[J] > P do Dec(J); if I <= J then begin T := A[I]; A[I] := A[J]; A[J] := T; Inc(I); Dec(J); end; until I > J; if L < J then f(A, L, J); L := I; until I >= R; end; Question 2 procedure f( var a : integer; var b : integer ); begin a := a xor b; b := a xor b; a := a xor b; end;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)