Re: Randomly outputting an array
- From: rossum <rossum48@xxxxxxxxxxxx>
- Date: Fri, 14 Jul 2006 21:46:02 +0100
On 14 Jul 2006 10:49:18 -0700, "ryanarossi@xxxxxxxxx"
<ryanarossi@xxxxxxxxx> wrote:
What would be the simplest way to output an array in random order, butKnuth, Vol 2, Algorithm 3.4.2P
every element in the array MUST be outputted and the elements cannot
repeat? My current code is below, which I simply have a very large
array and I am outputting windows of an arbitary length.
int c = 0;
int p = windowSize;
int q = 0;
int index = 0;
while (c < counter0 - (windowSize - 1))
{
for (index = q; index < p; index++)
{
Writer.Write(geneArray0[index]);
Writer.Write(" ");
}
Writer.Write("1");
Writer.WriteLine();
q++;
p++;
c++;
}
rossum
.
- References:
- Randomly outputting an array
- From: ryanarossi@xxxxxxxxx
- Randomly outputting an array
- Prev by Date: Re: What language for mathematical applications?
- Next by Date: Re: What language for mathematical applications?
- Previous by thread: Re: Randomly outputting an array
- Next by thread: Re: Randomly outputting an array
- Index(es):
Relevant Pages
|