Question: Write a program that do the following: 1- Create two matrices A of length N*M and B of length M and L, use any numbers

Write a program that do the following:

1- Create two matrices A of length N*M and B of length M and L, use any numbers to check validity

Crecreate matrix c of length N*L

2- Initialize these matrices randomly using method of range 1-20

4- Create N thread using executor service

ExecutorService executor = Executors.newFixedThreadPool(N);

Each thread will work on a row from Matrix A and will take the B , and c as input

5- Write the definition of The thread class named MultiplyThread which will Multiply row of A with Col of B to generate Row of C

6- In the Run method write a Multiply method

7- Print the 3 matrices A, b, and c in the main after All threads finished work.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!