Question: Analyze Algorithm 3.7 and show that it has a linear-time complexity //////////////////////////////////////////////////////Algorithm 3.7/////////////////////////////////////////// void order (index i, index j) { if( i == j) cout
Analyze Algorithm 3.7 and show that it has a linear-time complexity
//////////////////////////////////////////////////////Algorithm 3.7///////////////////////////////////////////
void order (index i, index j)
{
if( i == j)
cout << "A" << i
else {
k = P[i][j];
cout << "(";
order (i,k);
order(k+1, j);
cout << ")" ;
}
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
