All pastes #935586 Raw Edit

Someone

public text v1 · immutable
·published 2008-03-09 19:22 UTC
rendered paste body
procedure quicksort1(var tab:array of longint;
pocz,kon:longint);
var
oddzielacz,i,j,tmp:longint;
begin
oddzielacz:=tab[(pocz+kon) div 2];
i:=pocz;
j:=kon;
repeat
while tab[i]<oddzielacz do i:=i+1;
while tab[j]>oddzielacz do j:=j-1;
if i<=j then
begin
 tmp:=tab[j];
 tab[j]:=tab[i];
 tab[i]:=tmp;
 i:=i+1;
 j:=j-1;
end;
until(i>j);
if pocz<j then quicksort1(tab,pocz,j);
if i<kon then quicksort1(tab,i,kon);
end;