Posted by: prankster March 10, 2011
Login in to Rate this Post:
0
?
Non Cartesian product:
here is the pseudocode,
double first[10] = {1.2,1.3,5.6.......................}
double second[10] = {2.3, 4.2, 5.3,....................}
double product[10];
for (int i=0;i<10;i++)
{
product[i] = first[i] * second[i]
}
display product;
Cartesian product
double first[10] = {1.2,1.3,5.6.......................}
double second[10] = {2.3, 4.2, 5.3,....................}
double product[100]
int count = 0;
for (int i=0;i<10;i++)
{
for (j=0;j<10;j++)
{
product[count] = first[i] * second[j];
count ++
}
}
display product
here is the pseudocode,
double first[10] = {1.2,1.3,5.6.......................}
double second[10] = {2.3, 4.2, 5.3,....................}
double product[10];
for (int i=0;i<10;i++)
{
product[i] = first[i] * second[i]
}
display product;
Cartesian product
double first[10] = {1.2,1.3,5.6.......................}
double second[10] = {2.3, 4.2, 5.3,....................}
double product[100]
int count = 0;
for (int i=0;i<10;i++)
{
for (j=0;j<10;j++)
{
product[count] = first[i] * second[j];
count ++
}
}
display product