[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
begin
    pick two random numbers, a and b in [0..N-1]
    swap array [a] and array [b]
end
 
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
http://www.dfanning.com/code_tips/randperm.html
 
http://www.owlnet.rice.edu/~elec428/rng/per1.html
 

----- 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!
 
Regards.
 
---Lu 



  _____  




_______________________________________________
p2p-hackers mailing list
p2p-hackers at zgp.org
http://zgp.org/mailman/listinfo/p2p-hackers
_______________________________________________
Here is a web page listing P2P Conferences:
http://www.neurogrid.net/twiki/bin/view/Main/PeerToPeerConferences


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