Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

1. (40 points) Here’s an interesting algorithm:int anyEqual ( int n , A [ ] [ ]) { int i, j, k, m; for (i = 1; i for (j = 1; j for (k = 1; k XXXXXXXXXXfor (m = 1; m XXXXXXXXXXif (A[i] [j] == A [k] [m]...

1 answer below »
1. (40 points) Here’s an interesting algorithm:int anyEqual ( int n , A [ ] [ ])
{ int i, j, k, m; for (i = 1; i for (j = 1; j for (k = 1; k XXXXXXXXXXfor (m = 1; m XXXXXXXXXXif (A[i] [j] == A [k] [m] && ! (i == k && j == m XXXXXXXXXXreturn 1; return 0;}Write a function in C++ that implements this algorithm XXXXXXXXXXpoints) Let’s test the behavior of the performance behavior of this algorithm. Write a program that loops for array sizes of the 10, 20, 30, 40, 50, 100, 500, and 1000 that for each array size will loop 20 times to randomly fill an array of that size, execute the function from the previous question, and compute the average time the function used to do whatever it’s doing. Print a table with array sizes and the average for each array size.


Answered 1 days After Mar 13, 2022

Solution

Arun Shankar answered on Mar 15 2022
109 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here