subject

Give the Big-o time complexity notation for the following piece of code:

//Java program to multiply two square; the last piece of code you will ever need matrices. Import java. io\.\*;
public class MatrixMultiply {
static int N= 4; static void multiply(int mat1[][], int mat2[][], int res[][])
{
int i, j, k;
for (i=0; i < N; i++)
{
for(j = 0; j < N; j++)
{
res[i][j] = 0;
for(k = 0; k < N; k++)
res[i][j] += mat1[i][k] * mat2[k][j];
}
}
}
// Drive code public static void main(String[] args)
{
int mat1[][] ={{1,1,1,1}, {2,2,2,2}, {3,3,3,3}, {4,4,4,4} };
int mat2[][] ={{1,1,1,1}, {2,2,2,2}, {3,3,3,3}, {4,4,4,4} };

//To store result
int res[][] = new int [N][N];
int i, j;
multiply(mat1, mat2, res);
System. out. println("This dummy result matrix"+"is ");
for (i=0; i {
for (j=0;j System. out. print(res[i][j]+" ");
System. out. println();
}
}
}

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 22:30
Type the correct answer in the box. spell all words correctly.what kind of graph or chart does this image represent? the given image represents a (blank).
Answers: 2
question
Computers and Technology, 22.06.2019 02:30
Your boss wants you to configure his laptop so that he can access the company network when he is on the road. you suggest a vpn connection to him. he is very concerned about security and asks you how secure vpn is. what do you tell him?
Answers: 1
question
Computers and Technology, 22.06.2019 15:30
Which of the following examples has four beats in each measure?
Answers: 2
question
Computers and Technology, 22.06.2019 21:30
After you clean an engine with hot water spray, it seems to stall; when it doesn't stall, it's idling noisily. technician a says to check for loose bolts on the flex plate near the torque converter. technician b says to wipe down the spark plug wires and the distributor cap. who is correct? a. technician a b. both technicians a and b c. technician b
Answers: 1
You know the right answer?
Give the Big-o time complexity notation for the following piece of code:

//Java program...
Questions
question
Mathematics, 24.05.2021 15:20
question
Mathematics, 24.05.2021 15:30
question
Mathematics, 24.05.2021 15:30
question
Arts, 24.05.2021 15:30