Question: Please show code in JAVA and show how to graph values. (Do not copy previous answers) What you need to do: 1. Implement a simple

Please show code in JAVA and show how to graph values. (Do not copy previous answers)

Please show code in JAVA and show how to graph values. (Do

What you need to do: 1. Implement a simple algorithm to transpose an nxn matrix M 2. Collect the execution time T(n) as a function of n 3. Plot the functions T(n), T(n)?, and T(n)' on the same graph (if possible). 4. Refer to the analysis of the time complexity your performed for your Module / and discuss it in light of the graph you plotted above. Objective: 1. The objective of this programming assignment is to implement in your preferred language an algorithm to compute the transpose of an nxn matrix. We are interested in exploring the relationship between the time complexity and the "real time. For this exploration, you will collect the execution time T(n) as a function of n and plot T(n), T(n), and T(n) on the same graph. Finally, discuss your results. Program to implement collectData() Generate an LxL matrix G with a HUGE L (as huge as your language and machine allow) with random values // This must be done once for n = 100 to L (with step 100) copy in Matrix A the xn upper left matrix from Matrix G Start timing // We time the transposition of Matrix A for i = 1 to n-1 for j = i+1 to n // swap A[i] and A[j] buffer = A[i][j] A[i][j] = A[j][i] A[j][i] = buffer Store the value n and the values T(n), T(n)a, and T(n)3 in a file F where T(n) is the execution time. Data Analysis Use any plotting software (e.g., Excel) to plot the values T(n), T(n), and T(n)in File F as a function of n (on the same graph). File F is the file produced the program you implemented. Discuss your results based on the plot. (Hint: is T(n) closer to K.n, K.n2, or K. n}.log(n) where K is a constant?) How to Plot? I suggest to store the values in File F following the csv format used by Excel. Once the file F is in csv format, you can use Excel to plot

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!