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

Recommended Answers

All 5 Replies

i use pascal.

best regards.

yeah. i will give u QuickSort procedure

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...

commented: great :) +1
commented: worked +1
commented: :) +1

thaaaaaaaaanksss..... :)
i will try it.

i m glad to hear that.
happy coding :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.