I
Ike
I cannot get my head around how to code this algorithm, am hoping someone
has an idea that can get me started here.
If I have an array of N ints:
int array[N];
and I want to make an array of those N things, taken Q at a time, where Q >=
N (i.e.repetition is permitted).
For example, if I have N=2 where:
int arrayN[] = new int[{0, 1}] ;
and let's say Q = 3
double arrayQ=new double[{
{0,0,0},
{0,0,1},
{0,1,1},
{1,1,1},
{1,1,0},
{1,0,0},
{0,1,0},
{1,0,1}
}[;
I believe this will yeild N ^ Q permutations. I'm trying discern however,
how to go about creating a function to write out the new array[][] for a
given Q for a given one-dimensional input array. I'm into the train of
thinking whereby I have to "write code to write code," if you know what I
mean. Has anyone handled a problem similar to this in the past? Thanks, any
help is more than appreciated. -Ike
has an idea that can get me started here.
If I have an array of N ints:
int array[N];
and I want to make an array of those N things, taken Q at a time, where Q >=
N (i.e.repetition is permitted).
For example, if I have N=2 where:
int arrayN[] = new int[{0, 1}] ;
and let's say Q = 3
double arrayQ=new double[{
{0,0,0},
{0,0,1},
{0,1,1},
{1,1,1},
{1,1,0},
{1,0,0},
{0,1,0},
{1,0,1}
}[;
I believe this will yeild N ^ Q permutations. I'm trying discern however,
how to go about creating a function to write out the new array[][] for a
given Q for a given one-dimensional input array. I'm into the train of
thinking whereby I have to "write code to write code," if you know what I
mean. Has anyone handled a problem similar to this in the past? Thanks, any
help is more than appreciated. -Ike