pascal多关键字快排,哪里错了阿?求赐教!procedure qsort(l,r:longint);var i,j:longint;k,x:arr;beginif l>=r then exit;i:=l-1; j:=r+1; x:=a[random(r-l+1)+l];while true do beginrepeat inc(i) until (a[i].a>x.a)or((a[i].a=x.a)and(a[i].b>x.b));re
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/31 03:23:43
pascal多关键字快排,哪里错了阿?求赐教!procedure qsort(l,r:longint);var i,j:longint;k,x:arr;beginif l>=r then exit;i:=l-1; j:=r+1; x:=a[random(r-l+1)+l];while true do beginrepeat inc(i) until (a[i].a>x.a)or((a[i].a=x.a)and(a[i].b>x.b));re
pascal多关键字快排,哪里错了阿?求赐教!
procedure qsort(l,r:longint);
var i,j:longint;
k,x:arr;
begin
if l>=r then exit;
i:=l-1; j:=r+1; x:=a[random(r-l+1)+l];
while true do begin
repeat inc(i) until (a[i].a>x.a)or((a[i].a=x.a)and(a[i].b>x.b));
repeat dec(j) until (a[j].a
pascal多关键字快排,哪里错了阿?求赐教!procedure qsort(l,r:longint);var i,j:longint;k,x:arr;beginif l>=r then exit;i:=l-1; j:=r+1; x:=a[random(r-l+1)+l];while true do beginrepeat inc(i) until (a[i].a>x.a)or((a[i].a=x.a)and(a[i].b>x.b));re
procedure pai(l,r:longint);
var
i,j,mid1,mid2:longint;
t:re;
begin
i:=l;j:=r;
mid1:=a[(l+r)shr 1].x;
mid2:=a[(l+r)shr 1].y;
repeat
while (a[i].xmid2)) do dec(j);
if ij;
if i