1. What is the behavior? for(j=1; j<=n; j++) for(k=1; k<=n; k++) { c[j][k] = 0; for(l=1; l<=n; l++) c[j][k] = c[j][k] * b[l][k]; 2. What is the Total Frequency Count (TFC)? for(k = 1; k<=n+1; k++) { a++; b++; }
1. What is the behavior?
for(j=1; j<=n; j++)
for(k=1; k<=n; k++)
{
c[j][k] = 0;
for(l=1; l<=n; l++)
c[j][k] = c[j][k] * b[l][k];
2. What is the Total Frequency Count (TFC)?
for(k = 1; k<=n+1; k++)
{
a++;
b++;
}
3. What is the body of the outermost loop?
for(l=1; l<=c; l++)
for(j=c; j>=1; j--)
System.out.println(l + j);
for(k=1; k<=c; k++)
System.out.println(k);
4. What part of the loop is missing?
while(x <= 1)
{
k = k 1;
x = x + 1;
}
5.What is the Big-O notation?
ctr = 1;
while (ctr <= n-2)
{
for(k=1; k<=n; k++)
System.out.println(“ctr = ”+ctr);
ctr = ctr + 1;
}
5. What is the constant value in the Total Frequency Count (TFC)?
for(l=4; l<=n-5; l++)
for(j=5; j<=n+10; j++)
for(k=1; k<=n*n*2; k++)
y = y + 1;
a = a + 1;
Step by step
Solved in 4 steps