[p2p-hackers] permutation

mmukarrams mmukarrams at yahoo.com
Wed Nov 10 04:12:17 UTC 2004

I recall an algo from Knuth.  I hope I remember it correctly.
generate an array of size N
for i=1toN
    pick two random numbers, a and b in [0..N-1]
    swap array [a] and array [b]
you have your random permutation of size N.
-- Muhammad Mukarram Bin Tariq


From: p2p-hackers-bounces at zgp.org [mailto:p2p-hackers-bounces at zgp.org] On
Behalf Of RLWagner
Sent: Sunday, November 07, 2004 10:35 PM
To: Peer-to-peer development.
Subject: Re: [p2p-hackers] permutation

Random Permutation of Index Array

----- Original Message ----- 
From: Lutianbo <mailto:lutianbo at software.ict.ac.cn>  
To: p2p-hackers at zgp.org 
Sent: Monday, November 08, 2004 8:44 PM
Subject: [p2p-hackers] permutation

Hi all,
   Would you please tell me some papers about uniform random permutation of
an array?
Thank you!


p2p-hackers mailing list
p2p-hackers at zgp.org
Here is a web page listing P2P Conferences:

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://zgp.org/pipermail/p2p-hackers/attachments/20041110/74a5f4b1/attachment.htm

More information about the P2p-hackers mailing list