Logo.png


GnuplotBasic Plot

<poem>

   i ← length( a ) − 1
   while i ≥ 1
       j ← rand( 0, i )
       ( ai, aj ) ← ( aj, ai )
       ii − 1
   repeat

</poem>

Alternative notation:

<poem>

   for i := length( a ) − 1 down to 1 step -1 do
       j := rand( 0, i );
       swap( ai, aj )  od;

</poem>

<comments />

Sister Sites: GATE Overflow, GATE CSE Wiki, GATE CSE, Aptitude Overflow

This work is licensed under the CC By-SA 3.0 , without all the cruft that would otherwise be put at the bottom of the page.