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, 22.06.2019 06:20
In what kind of attack can attackers make use of millions of computers under their control in an attack against a single server or network availability confidentiality integrity identity automated attack software? those who wrongfully disclose individually identifiable health information can be fined up to what amount per calendar year? single most expensive malicious attack hipaa what are script kiddies? advanced persistent threat security manager security engineer what level of security access should a computer user have to do their job what process describes using technology as a basis for controlling the access and usage of sensitive data? cybercriminal
Answers: 1
question
Computers and Technology, 22.06.2019 18:30
Which of the following is an example of intellectual properly! oa. new version of a novelb. journal of ideasc. pages of a bookood. lines of a poem
Answers: 2
question
Computers and Technology, 24.06.2019 00:00
Which tool could be used to display only rows containing presidents who served two terms
Answers: 3
question
Computers and Technology, 24.06.2019 01:30
Hazel has just finished adding pictures to her holiday newsletter. she decides to crop an image. what is cropping an image?
Answers: 1
You know the right answer?
Give the Big-o time complexity notation for the following piece of code:

//Java program...
Questions
question
English, 19.10.2019 00:30
question
English, 19.10.2019 00:30
Questions on the website: 13722367