BELOW IS THE PSEUDOCODE .. MODIFY IT TO WORK WITH A SINGLEARRAY INSTEAD OF A TWO
ID: 3614314 • Letter: B
Question
BELOW IS THE PSEUDOCODE .. MODIFY IT TO WORK WITH A SINGLEARRAY INSTEAD OF A TWO DIM ARRAY... Public static int bin2 (int n, int k){
index i,j;
int [] [] B = new int[0..n][0..k];
for (i = 0; i <= n; i++)
for (j=0;j <= minimum(i,j); j++)
if (j ==0 || j==1)
B[i][j] = 1;
else
B[i][j] = B[i - 1][j - 1] +B[i - 1][j];
return B[n][k];
}
BELOW IS THE PSEUDOCODE .. MODIFY IT TO WORK WITH A SINGLEARRAY INSTEAD OF A TWO DIM ARRAY... Public static int bin2 (int n, int k)
{
index i,j;
int [] [] B = new int[0..n][0..k];
for (i = 0; i <= n; i++)
for (j=0;j <= minimum(i,j); j++)
if (j ==0 || j==1)
B[i][j] = 1;
else
B[i][j] = B[i - 1][j - 1] +B[i - 1][j];
return B[n][k];
}
Explanation / Answer
What is this supposed to do?
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.