Xref: utzoo comp.sources.wanted:7426 alt.msdos.programmer:48 Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!iuvax!bsu-cs!dhesi From: dhesi@bsu-cs.bsu.edu (Rahul Dhesi) Newsgroups: comp.sources.wanted,alt.msdos.programmer Subject: Re: Need algorithm to scramble order of array Message-ID: <7252@bsu-cs.bsu.edu> Date: 17 May 89 20:34:52 GMT References: <3008@cps3xx.UUCP> Reply-To: dhesi@bsu-cs.bsu.edu (Rahul Dhesi) Followup-To: alt.msdos.programmer Organization: CS Dept, Ball St U, Muncie, Indiana Lines: 9 >fast algorithm to randomly rearrange the order of elements in >an array. /* array a[1..N] */ for (i = N; i > 1; i--) swap (a[i], a[rnd(i-1)]); /* need random no. in range 1..i-1 */ -- Rahul Dhesi UUCP: ...!{iuvax,pur-ee}!bsu-cs!dhesi