Anybody know how to do this??
i really don't have idea with this.
please helps.
thx in advance.

try this following code :

{********************************************
  * This Procedure to Sort element vektor *
  * Procedure ATUR to organize an element position *
 ********************************************}
 procedure QUICKSORT (var A : Larik;
                          Awal, Akhir : integer);
 var I,J : integer;

 procedure ATUR;

 begin
 
   I := Aw + 1;
   J := Ak;

 
   while A[I] < A[Aw] do inc(I);


   while A[J] > A[Aw] do dec(J);
   while I < J do

     begin
       TUKARKAN(A[I],A[J]);
       while A[I] < A[Aw] do inc(I); {*To Right*}
       while A[J] > A[Aw] do dec(J); {* TO Left*}
     end;
   TUKARKAN(A[Aw],A[J])
 end;              
 
 begin
   if Aw < Ak then
      begin
        ATUR;
        QUICKSORT(A,Aw,J-1);
        QUICKSORT(A,J+1,Ak)
      end
 end;

Hope this helps...

Comments
worked
great :)
This question has already been answered. Start a new discussion instead.