function partition(l,r:integer):integer; var i,j:integer; begin i:=l-1; for j:=l to r-1 do if num[j]<=num[r] then begin inc(i); exchange(num[i],num[j]); end; exchange(num[i+1],num[r]); partition:=i+1; end;
procedure qsort(l,r:integer); var m:integer; begin if l<r then begin m:=partition(l,r); qsort(l,m-1); qsort(m+1,r); end; end;
When i was bored and had nothing to do , i clicked your blog to count my thumbs. To my astonishment, it's so easy and so difficult. I couldn't understand what you wrote. but as a friend, sent a message! by the way, do you like appointment?