H
Hanky Sjafrie
Greetings,
I need help on implementing a N-ary counter, which iterates from zero
to the maximum value allowed for each column. The maximum value of
n-th column should corresponds to the n-th value of the input array,
for example:
int[] inputArray ={2,1,3};
The output should be stored in a double array:
int[][] outputArray = new int[2*1*3][inputArray.length];
which has the values like these:
outputArray[0][] = {0,0,0}
outputArray[1][] = {0,0,1}
outputArray[2][] = {0,0,2}
outputArray[3][] = {1,0,0}
outputArray[4][] = {1,0,1}
outputArray[5][] = {1,0,2}
Probably a recursive will do, but I'm still out of luck... :-(
Any help would be greatly appreciated. Thanks in advance!
Regards,
Hanky
I need help on implementing a N-ary counter, which iterates from zero
to the maximum value allowed for each column. The maximum value of
n-th column should corresponds to the n-th value of the input array,
for example:
int[] inputArray ={2,1,3};
The output should be stored in a double array:
int[][] outputArray = new int[2*1*3][inputArray.length];
which has the values like these:
outputArray[0][] = {0,0,0}
outputArray[1][] = {0,0,1}
outputArray[2][] = {0,0,2}
outputArray[3][] = {1,0,0}
outputArray[4][] = {1,0,1}
outputArray[5][] = {1,0,2}
Probably a recursive will do, but I'm still out of luck... :-(
Any help would be greatly appreciated. Thanks in advance!
Regards,
Hanky