DAA Lab File-1
DAA Lab File-1
B11[i][j] = B[i][j];
B12[i][j] = B[i][j + newSize];
B21[i][j] = B[i + newSize][j];
B22[i][j] = B[i + newSize][j + newSize];
}
}
int main()
{
int n;
cout << "Enter the size of the matrices (must be a power of 2): ";
cin >> n;
cout << "Resultant matrix after multiplication using Strassen's algorithm:" <<
endl;
displayMatrix(C, n); // <--- Call displayMatrix to show the result
return 0;
}
Output:
Time Complexity:
Standard matrix multiplication: 𝑂(n )
Strassen’s algorithm: 𝑂(n . )